From c932e496fa461ac0a86d73842d728c7c3c7c0cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2015 17:08:36 +0200 Subject: [PATCH] SWU: Show reload dialog after update The notification and the (forced) dialog afterwards were way too redundant. --- .../softwareupdate/static/js/softwareupdate.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js index fd4ba14f..8b75047b 100644 --- a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js +++ b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js @@ -27,6 +27,8 @@ $(function() { {"key": "git_commit", "name": gettext("Commit")} ]; + self.reloadOverlay = $("#reloadui_overlay"); + self.versions = new ItemListHelper( "plugin.softwareupdate.versions", { @@ -329,18 +331,10 @@ $(function() { self.onDataUpdaterReconnect = function() { if (self.waitingForRestart) { self.waitingForRestart = false; - - var options = { - title: gettext("Restart successful!"), - text: gettext("The server was restarted successfully. The page will now reload automatically."), - type: "success", - hide: false - }; - self._showPopup(options); self.updateInProgress = false; - - var delay = 5 + Math.floor(Math.random() * 5) + 1; - setTimeout(function() {location.reload(true);}, delay * 1000); + if (!self.reloadOverlay.is(":visible")) { + self.reloadOverlay.show(); + } } };