Set parent window for about/new version, escape to close (#1795)

* Set parent window for about/new version, escape to close

* Exclude jquery from jshint run
This commit is contained in:
Scott Nonnenberg 2017-11-21 15:23:18 -08:00 committed by GitHub
parent 158b575885
commit 1c455c83e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9241 additions and 6 deletions

View file

@ -19,7 +19,7 @@ function checkForUpdates() {
}
var showingDialog = false;
function showUpdateDialog(messages) {
function showUpdateDialog(mainWindow, messages) {
if (showingDialog) {
return;
}
@ -38,7 +38,7 @@ function showUpdateDialog(messages) {
cancelId: LATER_BUTTON
}
dialog.showMessageBox(options, function(response) {
dialog.showMessageBox(mainWindow, options, function(response) {
if (response == RESTART_BUTTON) {
windowState.markShouldQuit();
autoUpdater.quitAndInstall();
@ -52,7 +52,7 @@ function onError(error) {
console.log("Got an error while updating: ", error.stack);
}
function initialize(messages) {
function initialize(getMainWindow, messages) {
if (!messages) {
throw new Error('auto-update initialize needs localized messages');
}
@ -62,7 +62,7 @@ function initialize(messages) {
}
autoUpdater.addListener('update-downloaded', function() {
showUpdateDialog(messages);
showUpdateDialog(getMainWindow(), messages);
});
autoUpdater.addListener('error', onError);