diff --git a/octoprint_simpleemergencystop/static/js/simpleemergencystop.js b/octoprint_simpleemergencystop/static/js/simpleemergencystop.js index 2312f91..72fa447 100644 --- a/octoprint_simpleemergencystop/static/js/simpleemergencystop.js +++ b/octoprint_simpleemergencystop/static/js/simpleemergencystop.js @@ -13,16 +13,11 @@ $(function() { self.printerState = parameters[2]; self.confirmation = undefined; - - - self.onAfterBinding = function() { self.confirmation = $("#confirmation"); self.settings = self.allSettings.settings.plugins.simpleemergencystop; }; - - self.click = function () { if(self.settings.confirmationDialog()) self.confirmation.modal("show"); @@ -30,6 +25,7 @@ $(function() { self.sendCommand() }; + self.sendCommand = function () { $.ajax({ url: API_BASEURL+"plugin/simpleemergencystop", @@ -47,6 +43,9 @@ $(function() { }; + self.visibleTest = function () { + return self.loginState.isUser() && self.printerState.isOperational() + }; } diff --git a/octoprint_simpleemergencystop/templates/simpleemergencystop_navbar.jinja2 b/octoprint_simpleemergencystop/templates/simpleemergencystop_navbar.jinja2 index 01360d6..990f502 100644 --- a/octoprint_simpleemergencystop/templates/simpleemergencystop_navbar.jinja2 +++ b/octoprint_simpleemergencystop/templates/simpleemergencystop_navbar.jinja2 @@ -1,4 +1,4 @@ - + diff --git a/setup.py b/setup.py index 3dd962c..dc5a4bf 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_package = "octoprint_simpleemergencystop" plugin_name = "OctoPrint-SimpleEmergencyStop" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.2.0" +plugin_version = "0.2.1" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module