From b168ef7e7451bb12eea36bd8376bc7edd5243bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sat, 10 Aug 2013 23:39:07 +0200 Subject: [PATCH] Only enable "Keep Enabled" button if data entered into form is valid. Also changed the wording a bit here and there. --- octoprint/static/js/ui.js | 2 + octoprint/templates/dialogs.jinja2 | 77 ++++++++++++++++-------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/octoprint/static/js/ui.js b/octoprint/static/js/ui.js index 470b34f9..12cc4ed5 100644 --- a/octoprint/static/js/ui.js +++ b/octoprint/static/js/ui.js @@ -1970,6 +1970,8 @@ function FirstRunViewModel() { }); self.keepAccessControl = function() { + if (!self.validData()) return; + var data = { "ac": true, "user": self.username(), diff --git a/octoprint/templates/dialogs.jinja2 b/octoprint/templates/dialogs.jinja2 index bab7fda9..5185742d 100644 --- a/octoprint/templates/dialogs.jinja2 +++ b/octoprint/templates/dialogs.jinja2 @@ -53,48 +53,51 @@ \ No newline at end of file