From c9a990513a1d06f1a634d69d591a22803933664b Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 24 Jan 2019 18:09:20 +0100 Subject: 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. --- cmd/monfront/main.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'cmd/monfront') 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}); + } }`, "checklist": `{{ template "header" . }}
-- cgit v1.2.3-70-g09d2