Bring Check for Updates to front if re-triggered, unify functions (#3861)
This commit is contained in:
parent
0b04a518e7
commit
009f2a5607
4 changed files with 18 additions and 7 deletions
|
@ -739,7 +739,8 @@ const ZoteroStandalone = new function() {
|
|||
* Checks for updates
|
||||
*/
|
||||
this.checkForUpdates = function() {
|
||||
window.open('chrome://zotero/content/update/updates.xhtml', 'updateChecker', 'chrome,centerscreen');
|
||||
Zotero.debug('ZoteroStandalone.checkForUpdates is deprecated -- use Zotero.openCheckForUpdatesWindow() instead');
|
||||
Zotero.openCheckForUpdatesWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1337,7 +1337,7 @@ Zotero.Sync.Runner_Module = function (options = {}) {
|
|||
e.errorType = 'warning';
|
||||
e.dialogButtonText = Zotero.getString('general.checkForUpdates');
|
||||
e.dialogButtonCallback = () => {
|
||||
Zotero.openCheckForUpdatesWindow();
|
||||
Zotero.openCheckForUpdatesWindow({ modal: true });
|
||||
};
|
||||
e.dialogButton2Text = Zotero.getString('general.moreInformation');
|
||||
e.dialogButton2Callback = () => {
|
||||
|
|
|
@ -649,7 +649,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
|||
|
||||
// "Check for Update" button
|
||||
if (index === 0) {
|
||||
Zotero.openCheckForUpdatesWindow();
|
||||
Zotero.openCheckForUpdatesWindow({ modal: true });
|
||||
}
|
||||
// Load More Info page
|
||||
else if (index == 2) {
|
||||
|
@ -973,9 +973,19 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
|||
}
|
||||
|
||||
|
||||
this.openCheckForUpdatesWindow = function () {
|
||||
Services.ww.openWindow(null, 'chrome://zotero/content/update/updates.xhtml',
|
||||
'updateChecker', 'chrome,centerscreen,modal', null);
|
||||
this.openCheckForUpdatesWindow = function ({ modal } = {}) {
|
||||
let win = Services.wm.getMostRecentWindow('Update:Wizard');
|
||||
if (win) {
|
||||
win.focus();
|
||||
}
|
||||
else {
|
||||
let flags = 'chrome,centerscreen';
|
||||
if (modal) {
|
||||
flags += ',modal';
|
||||
}
|
||||
Services.ww.openWindow(null, 'chrome://zotero/content/update/updates.xhtml',
|
||||
'updateChecker', flags, null);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@
|
|||
<menuitem id="checkForUpdates"
|
||||
accesskey="&helpCheckForUpdates.accesskey;"
|
||||
label="&helpCheckForUpdates.label;"
|
||||
oncommand="ZoteroStandalone.checkForUpdates();"/>
|
||||
oncommand="Zotero.openCheckForUpdatesWindow();"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutProduct.accesskey;"
|
||||
label="&aboutProduct.label;"
|
||||
|
|
Loading…
Reference in a new issue