From 5ca20f741a89c070395b4adac417d55f2c92deec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 11 Aug 2020 11:58:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Disable=20Set=20button=20when=20?= =?UTF-8?q?no=20rate=20is=20entered?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/static/js/app/viewmodels/control.js | 10 ++++++++-- src/octoprint/templates/tabs/control.jinja2 | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/control.js b/src/octoprint/static/js/app/viewmodels/control.js index a70a3e512..e24ff11a6 100644 --- a/src/octoprint/static/js/app/viewmodels/control.js +++ b/src/octoprint/static/js/app/viewmodels/control.js @@ -285,7 +285,10 @@ $(function() { self.feedRateBusy = ko.observable(false); self.feedRateResetter = ko.observable(); self.sendFeedRateCommand = function () { - var rate = _.parseInt(self.feedRate()); + var rate = self.feedRate(); + if (!rate) return; + + rate = _.parseInt(self.feedRate()); self.feedRateBusy(true); OctoPrint.printer.setFeedrate(rate) .done(function() { @@ -321,7 +324,10 @@ $(function() { self.flowRateBusy = ko.observable(false); self.flowRateResetter = ko.observable(); self.sendFlowRateCommand = function () { - var rate = _.parseInt(self.flowRate()); + var rate = self.flowRate(); + if (!rate) return; + + rate = _.parseInt(self.flowRate()); self.flowRateBusy(true); OctoPrint.printer.setFlowrate(rate) .done(function() { diff --git a/src/octoprint/templates/tabs/control.jinja2 b/src/octoprint/templates/tabs/control.jinja2 index 2ea4883c5..8c5eb86c9 100644 --- a/src/octoprint/templates/tabs/control.jinja2 +++ b/src/octoprint/templates/tabs/control.jinja2 @@ -82,9 +82,9 @@
- + % - +
@@ -112,9 +112,9 @@
- + % - +