From a64a0545f3c01cdb2168d6ad12142f2acf99c1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 17 Aug 2015 16:49:20 +0200 Subject: [PATCH] Display dialog on settings update if wizard is active --- src/octoprint/static/js/app/viewmodels/wizard.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/octoprint/static/js/app/viewmodels/wizard.js b/src/octoprint/static/js/app/viewmodels/wizard.js index 3a29c32a..c73d504b 100644 --- a/src/octoprint/static/js/app/viewmodels/wizard.js +++ b/src/octoprint/static/js/app/viewmodels/wizard.js @@ -134,6 +134,16 @@ $(function() { dataType: "json", success: callback }); + }; + + self.onSettingsPreventRefresh = function() { + if (self.isDialogActive() && hasDataChanged(self.settingsViewModel.getLocalData(), self.settingsViewModel.lastReceivedSettings)) { + // we have local changes, show update dialog + self.settingsViewModel.settingsUpdatedDialog.modal("show"); + return true; + } + + return false; } }