Skip to content

Commit 9243e91

Browse files
Cherrgjeffliu27
authored andcommitted
fix/define autochecked checkboxes on issue list in firefox (go-gitea#7320)
* fix/define autochecked checkboxes on issue list on firefox - close: deselect all - nonclose: show buttons for close/label/milestone... fix go-gitea#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>
1 parent bbd9dd6 commit 9243e91

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

public/js/index.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,21 @@ $(document).ready(function () {
21472147
elementId = '';
21482148
action = 'clear';
21492149
}
2150-
updateIssuesMeta(url, action, issueIDs, elementId).then(reload);
2150+
updateIssuesMeta(url, action, issueIDs, elementId).then(function() {
2151+
// NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the checkboxes stay checked after reload
2152+
if (action === "close" || action === "open" ){
2153+
//uncheck all checkboxes
2154+
$('.issue-checkbox input[type="checkbox"]').each(function(_,e){ e.checked = false; });
2155+
}
2156+
reload();
2157+
});
2158+
});
2159+
2160+
// NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay checked after reload
2161+
// trigger ckecked event, if checkboxes are checked on load
2162+
$('.issue-checkbox input[type="checkbox"]:checked').first().each(function(_,e) {
2163+
e.checked = false;
2164+
$(e).click();
21512165
});
21522166

21532167
buttonsClickOnEnter();

0 commit comments

Comments
 (0)