From 7372ada89006307eb8cb64c38543ecfd15f2dd21 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Fri, 20 Dec 2013 16:17:17 +0100 Subject: [PATCH] bit toggle: depend on attribute not on unicode symbol --- web/htdocs/scripts/xmlpage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/htdocs/scripts/xmlpage.js b/web/htdocs/scripts/xmlpage.js index dc6ffa9..11771f7 100644 --- a/web/htdocs/scripts/xmlpage.js +++ b/web/htdocs/scripts/xmlpage.js @@ -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; } -- 2.43.0