]> source.dussan.org Git - gitea.git/commitdiff
fix/define autochecked checkboxes on issue list in firefox (#7320)
authorCherrg <michael@gnehr.de>
Fri, 12 Jul 2019 20:16:23 +0000 (22:16 +0200)
committerzeripath <art27@cantab.net>
Fri, 12 Jul 2019 20:16:23 +0000 (21:16 +0100)
* 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 <michael@gnehr.de>
* remove unnessesary timeouts

Signed-off-by: Michael Gnehr <michael@gnehr.de>
* add comments in code - this is targeting firefox

Signed-off-by: Michael Gnehr <michael@gnehr.de>
public/js/index.js

index b4ce8c78b61269fdc82c7e6bb21906de7a2bcc2c..d890784abb3c795d6a89b250d29f0a3f78148a83 100644 (file)
@@ -2147,7 +2147,21 @@ $(document).ready(function () {
             elementId = '';
             action = 'clear';
         }
-        updateIssuesMeta(url, action, issueIDs, elementId).then(reload);
+        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; });
+            }
+            reload();
+        });
+    });
+
+    // 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;
+        $(e).click();
     });
 
     buttonsClickOnEnter();