diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml
index cb607a530b..44fd54693b 100644
--- a/chrome/content/zotero/bindings/noteeditor.xml
+++ b/chrome/content/zotero/bindings/noteeditor.xml
@@ -53,25 +53,38 @@
{
this._initialized = true;
});
+
+ window.fillTooltip = (tooltip) => {
+ let node = window.document.tooltipNode.closest('*[title]');
+ if (!node) {
+ return false;
+ }
- this.getNoteDataSync = () => {
- return this._editor.getNoteDataSync();
+ tooltip.setAttribute('label', node.getAttribute('title'));
+ return true;
+ }
+
+ this.saveSync = () => {
+ if (this._editorInstance) {
+ this._editorInstance.saveSync();
+ }
}
this.initEditor = async (state) => {
- if (this._editor) {
- this._editor.uninit();
+ if (this._editorInstance) {
+ this._editorInstance.uninit();
}
- this._editor = new Zotero.NoteEditor();
- await this._editor.init({
+ this._editorInstance = new Zotero.EditorInstance();
+ await this._editorInstance.init({
state,
item: this._item,
- window: document.getAnonymousElementByAttribute(this, "anonid", "rt-view1").contentWindow,
- onNavigate: this._navigateHandler,
+ iframeWindow: document.getAnonymousElementByAttribute(this, 'anonid', 'editor-view').contentWindow,
+ popup: document.getAnonymousElementByAttribute(this, 'anonid', 'editor-menu'),
+ onNavigate: this._navigateHandler
});
}
@@ -86,8 +99,8 @@
}
}
- if (this._editor) {
- await this._editor.updateCitationsForURIs(uris);
+ if (this._editorInstance) {
+ await this._editorInstance.updateCitationsForURIs(uris);
}
if (!this.item) return;
@@ -96,7 +109,7 @@
if (ids.includes(id)) {
let state = extraData && extraData[id] && extraData[id].state;
if (state) {
- if (extraData[id].noteEditorID !== this._editor.instanceID) {
+ if (extraData[id].noteEditorID !== this._editorInstance.instanceID) {
this.initEditor(state);
}
}
@@ -116,6 +129,7 @@
this._notifierID = Zotero.Notifier.registerObserver(this, ['item'], 'noteeditor');
]]>
+
"view"
@@ -194,10 +208,11 @@
this._lastHtmlValue = val.note;
- this._editor = new Zotero.NoteEditor();
- this._editor.init({
+ this._editorInstance = new Zotero.EditorInstance();
+ this._editorInstance.init({
item: val,
- window: document.getAnonymousElementByAttribute(this, "anonid", "rt-view1").contentWindow,
+ iframeWindow: document.getAnonymousElementByAttribute(this, "anonid", "editor-view").contentWindow,
+ popup: document.getAnonymousElementByAttribute(this, "anonid", "editor-menu"),
readOnly: !this.editable,
onNavigate: this._navigateHandler
});
@@ -233,8 +248,8 @@
@@ -246,6 +261,9 @@
@@ -258,44 +276,13 @@
]]>