diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index 485c47aed8..987c3d1b0f 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -241,11 +241,6 @@ // Update note var noteField = this._id('noteField'); if (this.item) { - if (!noteField.changed) { - Zotero.debug("Note hasn't been modified -- not saving"); - return; - } - let changed = this.item.setNote(noteField.value); if (changed && this.saveOnEdit) { yield this.item.saveTx(); diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index 32b0abe08e..4c0f6709d9 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -400,6 +400,7 @@ case 'keypress': // Ignore keypresses that don't change // any text + //Zotero.debug(event.which); if (!event.which && event.keyCode != event.DOM_VK_DELETE && event.keyCode != event.DOM_VK_BACK_SPACE) { @@ -426,18 +427,16 @@ clearTimeout(self._timer); } - if (event.type == 'change') { - self._changed = true; + // Trigger command event on change + if (event.type == 'keypress' || event.type == 'change') { + self._timer = self.timeout && setTimeout(function () { + var attr = self.getAttribute('oncommand'); + attr = attr.replace('this', 'thisObj'); + var func = new Function('thisObj', 'event', attr); + func(self, event); + }, self.timeout); } - // Get the command event - self._timer = self.timeout && setTimeout(function () { - var attr = self.getAttribute('oncommand'); - attr = attr.replace('this', 'thisObj'); - var func = new Function('thisObj', 'event', attr); - func(self, event); - }, self.timeout); - return true; }; break;