diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index 37659c63a4..e255ae4508 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -240,6 +240,11 @@ // 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 7eeb8bb41d..32b0abe08e 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -34,6 +34,7 @@ + @@ -425,6 +426,10 @@ clearTimeout(self._timer); } + if (event.type == 'change') { + self._changed = true; + } + // Get the command event self._timer = self.timeout && setTimeout(function () { var attr = self.getAttribute('oncommand'); @@ -534,9 +539,10 @@ html = '

'+html+"

"; } - Zotero.debug("SETTING CONTENT TO " + html); + Zotero.debug("Setting content to " + html); this._editor.setContent(html); + this._changed = false; return val; ]]> @@ -545,6 +551,8 @@ onset="this.setAttribute('timeout', val); return val;" onget="return parseInt(this.getAttribute('timeout')) || 0;"/> + +