Fix note saving in external window if note is selected in items list
This commit is contained in:
parent
5c677a3834
commit
3ad5ce45d0
|
@ -107,11 +107,15 @@
|
||||||
</setter>
|
</setter>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
<field name="_mtime"/>
|
||||||
|
|
||||||
<field name="_item"/>
|
<field name="_item"/>
|
||||||
<property name="item" onget="return this._item;">
|
<property name="item" onget="return this._item;">
|
||||||
<setter>
|
<setter>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
this._item = val;
|
this._item = val;
|
||||||
|
// TODO: use clientDateModified instead
|
||||||
|
this._mtime = val.getField('dateModified');
|
||||||
|
|
||||||
var parent = this.item.getSourceKey();
|
var parent = this.item.getSourceKey();
|
||||||
if (parent) {
|
if (parent) {
|
||||||
|
@ -216,6 +220,15 @@
|
||||||
|
|
||||||
// Update note
|
// Update note
|
||||||
if (this.item) {
|
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);
|
this.item.setNote(noteField.value);
|
||||||
if (this.saveOnEdit) {
|
if (this.saveOnEdit) {
|
||||||
this.item.save();
|
this.item.save();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user