mirror of
https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop.git
synced 2024-11-22 09:12:58 +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.printerState = parameters[2];
|
||||||
self.confirmation = undefined;
|
self.confirmation = undefined;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.onAfterBinding = function() {
|
self.onAfterBinding = function() {
|
||||||
self.confirmation = $("#confirmation");
|
self.confirmation = $("#confirmation");
|
||||||
self.settings = self.allSettings.settings.plugins.simpleemergencystop;
|
self.settings = self.allSettings.settings.plugins.simpleemergencystop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.click = function () {
|
self.click = function () {
|
||||||
if(self.settings.confirmationDialog())
|
if(self.settings.confirmationDialog())
|
||||||
self.confirmation.modal("show");
|
self.confirmation.modal("show");
|
||||||
@ -30,6 +25,7 @@ $(function() {
|
|||||||
self.sendCommand()
|
self.sendCommand()
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.sendCommand = function () {
|
self.sendCommand = function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: API_BASEURL+"plugin/simpleemergencystop",
|
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>
|
<i class="icon-warning-sign" style="color: red"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -14,7 +14,7 @@ plugin_package = "octoprint_simpleemergencystop"
|
|||||||
plugin_name = "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
|
# 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
|
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
||||||
# module
|
# module
|
||||||
|
Loading…
Reference in New Issue
Block a user