Focus preferences window if already open on Cmd-Comma

This commit is contained in:
Abe Jellinek 2023-05-19 16:46:24 +03:00
parent 874a45ed1c
commit ff43d1877e

View file

@ -59,13 +59,19 @@
// Equivalent to Zotero.Utilities.Internal.openPreferences()
function openPreferences() {
Services.ww.openWindow(
null,
'chrome://zotero/content/preferences/preferences.xhtml',
'zotero-prefs',
'chrome,titlebar,centerscreen,resizable=yes',
null
);
let win = Services.wm.getMostRecentWindow('zotero:pref');
if (win) {
win.focus();
}
else {
Services.ww.openWindow(
null,
'chrome://zotero/content/preferences/preferences.xhtml',
'zotero-prefs',
'chrome,titlebar,centerscreen,resizable=yes',
null
);
}
}
</script>
<commandset id="mainCommandSet">