diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/monfront/main.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cmd/monfront/main.go b/cmd/monfront/main.go index 1fccb95..605b4e7 100644 --- a/cmd/monfront/main.go +++ b/cmd/monfront/main.go @@ -643,16 +643,22 @@ var ( if (event.target.nodeName == 'INPUT') { return; } - for (i = 0; i < event.path.length; i++) { - if (event.path[i].nodeName != 'TR') { + current = event.target; + while (current = current.parentNode) { + if (current,nodeName == 'BODY') { + break; + } + if (current.nodeName != 'TR') { continue; } - e = event.path[i].children[0].children[0]; - e.checked = !e.checked; + e = current.children[0].children[0]; + if (e != event.target) { + e.checked = !e.checked; + } if (e.checked) { - event.path[i].classList.add("selected"); + current.classList.add("selected"); } else { - event.path[i].classList.remove("selected"); + current.classList.remove("selected"); } e.focus(); break; |