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

This commit is contained in:
Dan Stillman 2011-03-31 10:14:05 +00:00
parent 5c677a3834
commit 3ad5ce45d0

View File

@ -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();