fix issue with touch ui max slider value being wrong and fix padding

if touchui was active the max value was 255, also added a bit of extra width so the button doesn't resize (at least when the button text is in english)
This commit is contained in:
ntoff 2017-11-18 04:18:37 +10:00
parent addd0ffa4b
commit b359461d80

View File

@ -78,7 +78,7 @@ $(function () {
$("#fan-off").remove(); $("#fan-off").remove();
//add new fan controls //add new fan controls
$("#control-jog-general").find("button").eq(0).before("\ $("#control-jog-general").find("button").eq(0).before("\
<input type=\"number\" style=\"width: 90px\" data-bind=\"slider: {min: 00, max: 100, step: 1, value: fanSpeed, tooltip: 'hide'}\">\ <input type=\"number\" style=\"width: 95px\" data-bind=\"slider: {min: 00, max: 100, step: 1, value: fanSpeed, tooltip: 'hide'}\">\
<button class=\"btn btn-block control-box\" id=\"fan-on\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendFanSpeed() }\">" + gettext("Fan speed") + ":<span data-bind=\"text: fanSpeed() + '%'\"></span></button>\ <button class=\"btn btn-block control-box\" id=\"fan-on\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendFanSpeed() }\">" + gettext("Fan speed") + ":<span data-bind=\"text: fanSpeed() + '%'\"></span></button>\
<button class=\"btn btn-block control-box\" id=\"fan-off\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendCustomCommand({ type: 'command', commands: ['M106 S0'] }) }\">" + gettext("Fan off") + "</button>\ <button class=\"btn btn-block control-box\" id=\"fan-off\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendCustomCommand({ type: 'command', commands: ['M106 S0'] }) }\">" + gettext("Fan off") + "</button>\
"); ");
@ -92,7 +92,7 @@ $(function () {
$("#control-jog-extrusion").after("\ $("#control-jog-extrusion").after("\
<div id=\"control-fan-slider\" class=\"jog-panel filament\" data-bind=\"visible: loginState.isUser\">\ <div id=\"control-fan-slider\" class=\"jog-panel filament\" data-bind=\"visible: loginState.isUser\">\
<div>\ <div>\
<input type=\"number\" style=\"width: 150px\" data-bind=\"slider: {min: 00, max: 255, step: 1, value: fanSpeed, tooltip: 'hide'}\">\ <input type=\"number\" style=\"width: 150px\" data-bind=\"slider: {min: 00, max: 100, step: 1, value: fanSpeed, tooltip: 'hide'}\">\
<button class=\"btn btn-block\" style=\"width: 169px\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendFanSpeed() }\">" + gettext("Fan speed:") + "<span data-bind=\"text: fanSpeed() + '%'\"></span></button>\ <button class=\"btn btn-block\" style=\"width: 169px\" data-bind=\"enable: isOperational() && loginState.isUser(), click: function() { $root.sendFanSpeed() }\">" + gettext("Fan speed:") + "<span data-bind=\"text: fanSpeed() + '%'\"></span></button>\
</div>\ </div>\
</div>\ </div>\
@ -126,7 +126,7 @@ $(function () {
} }
else { else {
self.control.fanSpeed(self.control.defaultFanSpeed()); self.control.fanSpeed(self.control.defaultFanSpeed());
} }
} }
//update settings in case user changes them, otherwise a refresh of the UI is required //update settings in case user changes them, otherwise a refresh of the UI is required