mirror of
https://github.com/zotero/zotero.git
synced 2026-10-05 02:43:38 +00:00
Ensure read-only fields don't save on blur (#5468)
Fixes tabbing out of Scaffold's abstract box causing the test item to be added to the user's library. And use same format as itemPaneHeader.js in abstractBox.js.
This commit is contained in:
parent
f3227275b1
commit
a993ac74f1
2 changed files with 15 additions and 3 deletions
|
|
@ -89,9 +89,15 @@
|
|||
}
|
||||
|
||||
async save() {
|
||||
if (this.item) {
|
||||
this.item.setField('abstractNote', this._abstractField.value);
|
||||
await this.item.saveTx();
|
||||
if (!this.editable) {
|
||||
return;
|
||||
}
|
||||
if (this._item) {
|
||||
if (!this._item.itemID) {
|
||||
throw new Error('Item has not been added to library');
|
||||
}
|
||||
this._item.setField('abstractNote', this._abstractField.value);
|
||||
await this._item.saveTx();
|
||||
}
|
||||
this._forceRenderAll();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,13 @@
|
|||
}
|
||||
|
||||
async save() {
|
||||
if (!this.editable) {
|
||||
return;
|
||||
}
|
||||
if (this._item) {
|
||||
if (!this._item.itemID) {
|
||||
throw new Error('Item has not been added to library');
|
||||
}
|
||||
this._item.setField(this._titleFieldID, this.titleField.value);
|
||||
await this._item.saveTx();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue