Prevent SWU popup when wizard is open

This commit is contained in:
Gina Häußge 2016-11-24 11:28:45 +01:00
parent 01b221ab30
commit 462ab5aa37
4 changed files with 13 additions and 2 deletions

View file

@ -335,7 +335,7 @@ $(function() {
};
}
if (ignoreSeen || !self._hasNotificationBeenSeen(data.information)) {
if ((ignoreSeen || !self._hasNotificationBeenSeen(data.information)) && !OctoPrint.coreui.wizardOpen) {
self._showPopup(options, eventListeners);
}
} else if (data.status == "current") {

View file

@ -36,7 +36,9 @@ $(function() {
OctoPrint.coreui = (function() {
var exports = {
browserTabVisibility: undefined,
selectedTab: undefined
selectedTab: undefined,
settingsOpen: false,
wizardOpen: false
};
var browserVisibilityCallbacks = [];

View file

@ -360,12 +360,14 @@ $(function() {
self.allViewModels = allViewModels;
self.settingsDialog.on('show', function(event) {
OctoPrint.coreui.settingsOpen = true;
if (event.target.id == "settings_dialog") {
self.requestTranslationData();
callViewModels(allViewModels, "onSettingsShown");
}
});
self.settingsDialog.on('hidden', function(event) {
OctoPrint.coreui.settingsOpen = false;
if (event.target.id == "settings_dialog") {
callViewModels(allViewModels, "onSettingsHidden");
}

View file

@ -43,6 +43,13 @@ $(function() {
self.onStartup = function() {
self.wizardDialog = $("#wizard_dialog");
self.wizardDialog.on('show', function(event) {
OctoPrint.coreui.wizardOpen = true;
});
self.wizardDialog.on('hidden', function(event) {
OctoPrint.coreui.wizardOpen = false;
});
self.reloadOverlay = $("#reloadui_overlay");
};