]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
bit toggle: depend on attribute not on unicode symbol
authorPhilipp Klaus <pklaus@ikf.uni-frankfurt.de>
Fri, 20 Dec 2013 15:17:17 +0000 (16:17 +0100)
committerPhilipp Klaus <pklaus@ikf.uni-frankfurt.de>
Fri, 20 Dec 2013 15:17:17 +0000 (16:17 +0100)
web/htdocs/scripts/xmlpage.js

index dc6ffa916e846f64460c747d29e74de8b2f83150..11771f7280b3390bfd28cf07740ecd43b0db8912 100644 (file)
@@ -1,11 +1,11 @@
   function editsetting(e) {
     if(e.target.getAttribute("class") && e.target.getAttribute("class").indexOf("editable")!=-1) {
       var curr = e.target.innerHTML.split('<',1);
-      if (curr == '\u25a1' || curr == '\u25a0') { // search for □ and ■
+      if (e.target.parentNode.getAttribute("bit") == '1') { // search for fields that represent single bits
         console.debug("single bit clicked");
-        if (curr == '\u25a1') // in case it's □
+        if ( parseInt(e.target.parentNode.getAttribute("raw")) == 0 )
           getdataprint('../xml-db/put.pl?'+e.target.parentNode.getAttribute("cstr")+'-'+'1','returntext',false,-1,refresh);
-        if (curr == '\u25a0') // in case it's ■
+        if ( parseInt(e.target.parentNode.getAttribute("raw")) == 1 )
           getdataprint('../xml-db/put.pl?'+e.target.parentNode.getAttribute("cstr")+'-'+'0','returntext',false,-1,refresh);
         return;
       }