genericnode: show negation in label
This commit is contained in:
parent
caf8383b6f
commit
036b6d6099
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user