www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3ad5ce45d09218827a2d8b5818d36da5f2a4f624
parent 5c677a3834c0e2bdbcf2808da8abeeb56883b614
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 31 Mar 2011 10:14:05 +0000

Fix note saving in external window if note is selected in items list


Diffstat:
Mchrome/content/zotero/bindings/noteeditor.xml | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml @@ -107,11 +107,15 @@ </setter> </property> + <field name="_mtime"/> + <field name="_item"/> <property name="item" onget="return this._item;"> <setter> <![CDATA[ this._item = val; + // TODO: use clientDateModified instead + this._mtime = val.getField('dateModified'); var parent = this.item.getSourceKey(); if (parent) { @@ -216,6 +220,15 @@ // Update note if (this.item) { + // If note is reselected automatically after save + // from external note window, don't overwrite content + // + // TODO: use clientDateModified instead + if (this.item.getField('dateModified') != this._mtime) { + Zotero.debug("Note has already been changed", 4); + return; + } + this.item.setNote(noteField.value); if (this.saveOnEdit) { this.item.save();