mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-12-24 15:36:43 +01:00
Icon is now not visible when you are not logged in --> #5
This commit is contained in:
parent
a47f21e2f9
commit
a2061658fd
@ -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()
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<a data-bind="click: click, visible: loginState.isUser && printerState.isOperational" href="#">
|
||||
<a data-bind="click: click, visible: visibleTest()" href="#">
|
||||
<i class="icon-warning-sign" style="color: red"></i>
|
||||
</a>
|
||||
|
||||
|
2
setup.py
2
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
|
||||
|
Loading…
Reference in New Issue
Block a user