From 529f2aaab34c48ab4d9b96a632b78b7b821f32c9 Mon Sep 17 00:00:00 2001 From: Michael Gnehr Date: Fri, 28 Jun 2019 08:18:24 +0200 Subject: [PATCH 1/3] fix/define autochecked checkboxes on issue list on firefox - close: deselect all - nonclose: show buttons for close/label/milestone... fix #7311 Signed-off-by: Michael Gnehr --- public/js/index.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 53fcaa8ba1eb..ae7fdd243afe 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2106,13 +2106,27 @@ $(document).ready(function () { }); $('.issue-action').click(function () { - var action = this.dataset.action - var elementId = this.dataset.elementId - var issueIDs = $('.issue-checkbox').children('input:checked').map(function() { + let action = this.dataset.action; + let elementId = this.dataset.elementId; + let issueIDs = $('.issue-checkbox').children('input:checked').map(function() { return this.dataset.issueId; }).get().join(); - var url = this.dataset.url - updateIssuesMeta(url, action, issueIDs, elementId).then(reload); + let url = this.dataset.url; + updateIssuesMeta(url, action, issueIDs, elementId).then(function() { + if (action === "close" || action === "open" ){ + //uncheck all checkboxes + $('.issue-checkbox input[type="checkbox"]').each(function(_,e){ e.checked = false; }); + } + setTimeout(reload, 5); + }); + }); + + // trigger ckecked event, if checkboxes are checked on load + $('.issue-checkbox input[type="checkbox"]:checked').first().each(function(_,e) { + e.checked = false; + setTimeout(function(){ + $(e).click(); + }, 5); }); buttonsClickOnEnter(); From 8599e42bda99901111e0e59c998a0edbe9fef3bb Mon Sep 17 00:00:00 2001 From: Michael Gnehr Date: Fri, 28 Jun 2019 15:05:39 +0200 Subject: [PATCH 2/3] remove unnessesary timeouts Signed-off-by: Michael Gnehr --- public/js/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index ae7fdd243afe..e24d85f47eaf 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2117,16 +2117,14 @@ $(document).ready(function () { //uncheck all checkboxes $('.issue-checkbox input[type="checkbox"]').each(function(_,e){ e.checked = false; }); } - setTimeout(reload, 5); + reload(); }); }); // trigger ckecked event, if checkboxes are checked on load $('.issue-checkbox input[type="checkbox"]:checked').first().each(function(_,e) { e.checked = false; - setTimeout(function(){ - $(e).click(); - }, 5); + $(e).click(); }); buttonsClickOnEnter(); From dbe347fb613efecc800f0311147f4e62f477d27e Mon Sep 17 00:00:00 2001 From: Michael Gnehr Date: Fri, 12 Jul 2019 13:45:13 +0200 Subject: [PATCH 3/3] add comments in code - this is targeting firefox Signed-off-by: Michael Gnehr --- public/js/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/index.js b/public/js/index.js index e24d85f47eaf..5de6616651fc 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2113,6 +2113,7 @@ $(document).ready(function () { }).get().join(); let url = this.dataset.url; updateIssuesMeta(url, action, issueIDs, elementId).then(function() { + // NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the checkboxes stay checked after reload if (action === "close" || action === "open" ){ //uncheck all checkboxes $('.issue-checkbox input[type="checkbox"]').each(function(_,e){ e.checked = false; }); @@ -2121,6 +2122,7 @@ $(document).ready(function () { }); }); + // NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay checked after reload // trigger ckecked event, if checkboxes are checked on load $('.issue-checkbox input[type="checkbox"]:checked').first().each(function(_,e) { e.checked = false;