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).
This commit is contained in:
Dan Stillman 2018-02-28 21:10:55 -05:00
parent 3cc92fe1e9
commit 081793f72f
3 changed files with 5 additions and 3 deletions

View file

@ -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;
}

View file

@ -70,6 +70,7 @@ async function onLoad() {
noteEditor.refresh();
}
noteEditor.focus();
notifierUnregisterID = Zotero.Notifier.registerObserver(NotifyCallback, 'item', 'noteWindow');
}

View file

@ -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',