[Debian-iot-packaging] [openzwave-controlpanel] 49/81: fix up Lists that contain On/Off from getting changed

Dara Adib daradib-guest at moszumanska.debian.org
Thu Dec 22 16:57:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.

commit b34940c7044272cb0846a5310b7ea6553adef0cc
Author: Justin Hammond <justin at dynam.ac>
Date:   Thu Jul 2 00:34:56 2015 +0800

    fix up Lists that contain On/Off from getting changed
---
 cp.js | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/cp.js b/cp.js
index 7b00c8a..ec2ab02 100644
--- a/cp.js
+++ b/cp.js
@@ -508,17 +508,19 @@ function DoConfig(id)
     return false;
   }
 }
-function DoValue(id)
+function DoValue(id, convert = true)
 {
   if (curnode != null) {
     var posthttp;
     var params;
     var arg=document.getElementById(id).value;
 
-    if (arg.toLowerCase() == 'off')
-      arg = 'false';
-    else if (arg.toLowerCase() == 'on')
-      arg = 'true';
+    if (convert) {
+	    if (arg.toLowerCase() == 'off')
+	      arg = 'false';
+    	else if (arg.toLowerCase() == 'on')
+      	arg = 'true';
+    }
     params=id+'='+arg;
     if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
       posthttp=new XMLHttpRequest();
@@ -1538,7 +1540,7 @@ function CreateList(i,j,vid)
   var data='<tr><td style="float: right;"';
   if (nodes[i].values[j].help.length > 0)
     data=data+' onmouseover="ShowToolTip(\''+quotestring(nodes[i].values[j].help)+'\',0);" onmouseout="HideToolTip();"';
-  data=data+'><label><span class="legend">'+nodes[i].values[j].label+': </span></label></td><td><select id="'+vid+'" onchange="return DoValue(\''+vid+'\');"';
+  data=data+'><label><span class="legend">'+nodes[i].values[j].label+': </span></label></td><td><select id="'+vid+'" onchange="return DoValue(\''+vid+'\', false);"';
   if (nodes[i].values[j].help.length > 0)
     data=data+' onmouseover="ShowToolTip(\''+quotestring(nodes[i].values[j].help)+'\',0);" onmouseout="HideToolTip();"';
   if (nodes[i].values[j].readonly)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git



More information about the Debian-iot-packaging mailing list