commit 081793f72f65a691484b95adf901b473170c8e1e
parent 3cc92fe1e9c7ed8acdac3d4b824e0eccb5da21ab
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 28 Feb 2018 21:10:55 -0500
Disable auto_focus for TinyMCE
TinyMCE triggers a focus on the window itself, which means that the
window steals focus when an attachment is created even if another Zotero
window is in front. Instead, do a manual focus in the external note
window, which is the one place I could find where we rely on it (though
there might be others).
Diffstat:
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -709,8 +709,10 @@
self.value = self._value;
}
if (self._focus) {
- self._iframe.focus();
- self._editor.focus();
+ setTimeout(function () {
+ self._iframe.focus();
+ self._editor.focus();
+ });
self._focus = false;
}
diff --git a/chrome/content/zotero/note.js b/chrome/content/zotero/note.js
@@ -70,6 +70,7 @@ async function onLoad() {
noteEditor.refresh();
}
+ noteEditor.focus();
notifierUnregisterID = Zotero.Notifier.registerObserver(NotifyCallback, 'item', 'noteWindow');
}
diff --git a/resource/tinymce/note.html b/resource/tinymce/note.html
@@ -10,7 +10,6 @@
body_id: "zotero-tinymce-note",
content_css: "css/note-content.css",
- auto_focus: "tinymce",
browser_spellcheck: true,
convert_urls: false,
entity_encoding: 'raw',