diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2019-01-24 18:09:20 +0100 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2019-01-24 18:09:20 +0100 |
commit | c9a990513a1d06f1a634d69d591a22803933664b (patch) | |
tree | 897b0ff21b72a92124e08ee257ff2405012a1c13 /cmd/monfront | |
parent | aff501bebc99c405130c7414941e6f039d2fdf9d (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')
-rw-r--r-- | cmd/monfront/main.go | 16 |
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"> |