Skip to content

Commit 529f2aa

Browse files
committed
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 <[email protected]>
1 parent 855ebbd commit 529f2aa

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

public/js/index.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,13 +2106,27 @@ $(document).ready(function () {
21062106
});
21072107

21082108
$('.issue-action').click(function () {
2109-
var action = this.dataset.action
2110-
var elementId = this.dataset.elementId
2111-
var issueIDs = $('.issue-checkbox').children('input:checked').map(function() {
2109+
let action = this.dataset.action;
2110+
let elementId = this.dataset.elementId;
2111+
let issueIDs = $('.issue-checkbox').children('input:checked').map(function() {
21122112
return this.dataset.issueId;
21132113
}).get().join();
2114-
var url = this.dataset.url
2115-
updateIssuesMeta(url, action, issueIDs, elementId).then(reload);
2114+
let url = this.dataset.url;
2115+
updateIssuesMeta(url, action, issueIDs, elementId).then(function() {
2116+
if (action === "close" || action === "open" ){
2117+
//uncheck all checkboxes
2118+
$('.issue-checkbox input[type="checkbox"]').each(function(_,e){ e.checked = false; });
2119+
}
2120+
setTimeout(reload, 5);
2121+
});
2122+
});
2123+
2124+
// trigger ckecked event, if checkboxes are checked on load
2125+
$('.issue-checkbox input[type="checkbox"]:checked').first().each(function(_,e) {
2126+
e.checked = false;
2127+
setTimeout(function(){
2128+
$(e).click();
2129+
}, 5);
21162130
});
21172131

21182132
buttonsClickOnEnter();

0 commit comments

Comments
 (0)