aboutsummaryrefslogtreecommitdiff
path: root/cmd/monfront/main.go
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2019-01-24 18:09:20 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2019-01-24 18:09:20 +0100
commitc9a990513a1d06f1a634d69d591a22803933664b (patch)
tree897b0ff21b72a92124e08ee257ff2405012a1c13 /cmd/monfront/main.go
parentaff501bebc99c405130c7414941e6f039d2fdf9d (diff)
monfront - final fix for select all
There was an issue with the select all in that clicking an input field didn't trigger the marking as the event was not pushed through to the underlying elements.
Diffstat (limited to 'cmd/monfront/main.go')
-rw-r--r--cmd/monfront/main.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/monfront/main.go b/cmd/monfront/main.go
index 3f71727..048a09c 100644
--- a/cmd/monfront/main.go
+++ b/cmd/monfront/main.go
@@ -685,13 +685,17 @@ var (
input.focus();
}
- els = document.querySelectorAll('thead > tr');
- for (i = 0; i < els.length; i++) {
- els[i].addEventListener('click', {handleEvent: row_head_click_event});
+ for (selector of ['thead > tr', 'thead input']) {
+ els = document.querySelectorAll(selector);
+ for (i = 0; i < els.length; i++) {
+ els[i].addEventListener('click', {handleEvent: row_head_click_event});
+ }
}
- els = document.querySelectorAll('tbody > tr');
- for (i = 0; i < els.length; i++) {
- els[i].addEventListener('click', {handleEvent: row_click_event});
+ for (selector of ['tbody > tr', 'tbody input']) {
+ els = document.querySelectorAll(selector);
+ for (i = 0; i < els.length; i++) {
+ els[i].addEventListener('click', {handleEvent: row_click_event});
+ }
}</script></body></html>`,
"checklist": `{{ template "header" . }}
<form method="post" action="/action">