From 036b6d609933e0cc63b987482ef1f6f920813fee Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 8 Jul 2015 20:50:26 +0200 Subject: [PATCH] genericnode: show negation in label --- lib/filters/genericnode.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/filters/genericnode.js b/lib/filters/genericnode.js index 832823c..936e71d 100644 --- a/lib/filters/genericnode.js +++ b/lib/filters/genericnode.js @@ -3,6 +3,11 @@ define(["filters/nodefilter"], function (nodefilter) { var negate = false var refresh + var label = document.createElement("label") + var strong = document.createElement("strong") + label.textContent = name + " " + label.appendChild(strong) + function run(d) { var o = dictGet(d, key.slice(0)) @@ -21,18 +26,14 @@ define(["filters/nodefilter"], function (nodefilter) { el.parentNode.classList.add("not") else el.parentNode.classList.remove("not") + + strong.textContent = (negate ? "¬" : "" ) + value } function render(el) { - var label = document.createElement("label") - label.textContent = name + " " - - var strong = document.createElement("strong") - strong.textContent = value - + el.appendChild(label) draw(el) - label.appendChild(strong) label.onclick = function () { negate = !negate @@ -41,8 +42,6 @@ define(["filters/nodefilter"], function (nodefilter) { if (refresh) refresh() } - - el.appendChild(label) } return { run: nodefilter(run),