From 21e4627da29af5210a32c5eea6050d874d05315f Mon Sep 17 00:00:00 2001 From: ntoff Date: Sun, 12 Nov 2017 04:46:00 +1000 Subject: [PATCH] missing span on touchui button + less global hopefully nothing global "use strict" seems to not complain :D --- octoprint_fanspeedslider/static/js/fanslider.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/octoprint_fanspeedslider/static/js/fanslider.js b/octoprint_fanspeedslider/static/js/fanslider.js index cf100d0..9d6940c 100644 --- a/octoprint_fanspeedslider/static/js/fanslider.js +++ b/octoprint_fanspeedslider/static/js/fanslider.js @@ -5,7 +5,7 @@ $(function() { function FanSliderPluginViewModel(parameters) { - //'use strict'; + 'use strict'; var self = this; self.settings = parameters[0]; @@ -29,8 +29,8 @@ $(function() { } }; - //send gcode to set fan speed TODO: not be a global function - sendFanSpeed = ko.pureComputed(function () { + //send gcode to set fan speed + self.control.sendFanSpeed = ko.pureComputed(function () { self.speed = self.control.fanSpeed() * 255 / 100 //don't forget to limit this to 2 decimal places at some point. if (self.control.fanSpeed() < self.control.minFanSpeed() && self.control.fanSpeed() != "0") { console.log("Fan Speed Control Plugin: " + self.control.fanSpeed() + "% is less than the minimum speed ("+self.control.minFanSpeed()+"%), increasing."); @@ -65,21 +65,21 @@ $(function() { //add new fan controls $("#control-jog-general").find("button").eq(0).before("\ \ - \ + \ \ "); } else { //replace touch UI's fan on button with one that sends whatever speed is set in this plugin $("#fan-on").remove(); $("#control-jog-general").find("button").eq(0).after("\ - \ + \ "); //also add spin box + button below in its own section, button is redundant but convenient $("#control-jog-extrusion").after("\
\
\ \ - \ + \
\
\ ");