diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index b7c8ccc68..cae663895 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -65,6 +65,11 @@ switch (val) { case 'view': case 'merge': + // If there's an existing editor, mark it as read-only. This allows for + // disabling an existing editable note (e.g., if there's a save error). + if (this.noteField) { + this.noteField.onInit(ed => ed.setMode('readonly')); + } break; case 'edit': @@ -243,9 +248,9 @@ - - - + this.item = item; + } + catch (e) { + Zotero.logError(e); + + if (this.hasAttribute('onerror')) { + let fn = new Function("", this.getAttribute('onerror')); + fn.call(this) + } + if (this.onError) { + this.onError(e); + } + } + }.bind(this)); + ]]> diff --git a/chrome/content/zotero/itemPane.xul b/chrome/content/zotero/itemPane.xul index 3609daa1b..8f40a346b 100644 --- a/chrome/content/zotero/itemPane.xul +++ b/chrome/content/zotero/itemPane.xul @@ -113,7 +113,7 @@ --> + onerror="ZoteroPane.displayErrorMessage(); this.mode = 'view'"/>