<div id="issue-filters" class="ui stackable grid">
<div class="six wide column">
{{if $.CanWriteIssuesOrPulls}}
- <div class="ui checkbox issue-checkbox-all gt-vm">
- <input type="checkbox" title="{{.locale.Tr "repo.issues.action_check_all"}}">
- </div>
+ <input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-vm gt-mr-4" title="{{.locale.Tr "repo.issues.action_check_all"}}">
{{end}}
{{template "repo/issue/openclose" .}}
</div>
{{$approvalCounts := .ApprovalCounts}}
{{range .Issues}}
<li class="item gt-df gt-py-3">
- <div class="issue-item-left gt-df">
+ <div class="issue-item-left gt-df gt-items-start">
{{if $.CanWriteIssuesOrPulls}}
- <div class="ui checkbox issue-checkbox">
- <input type="checkbox" data-issue-id={{.ID}} title="{{$.locale.Tr "repo.issues.action_check"}} «{{.Title}}»">
- </div>
+ <input type="checkbox" autocomplete="off" class="issue-checkbox gt-mt-2 gt-mr-4" data-issue-id={{.ID}} aria-label="{{$.locale.Tr "repo.issues.action_check"}} "{{.Title}}"">
{{end}}
<div class="issue-item-icon">
{{if .IsPull}}
import {toggleElem} from '../utils/dom.js';
export function initCommonIssue() {
- const $issueSelectAllWrapper = $('.issue-checkbox-all');
- const $issueSelectAll = $('.issue-checkbox-all input');
- const $issueCheckboxes = $('.issue-checkbox input');
+ const $issueSelectAll = $('.issue-checkbox-all');
+ const $issueCheckboxes = $('.issue-checkbox');
const syncIssueSelectionState = () => {
const $checked = $issueCheckboxes.filter(':checked');
toggleElem($('#issue-filters'), !anyChecked);
toggleElem($('#issue-actions'), anyChecked);
// there are two panels but only one select-all checkbox, so move the checkbox to the visible panel
- $('#issue-filters, #issue-actions').filter(':visible').find('.column:first').prepend($issueSelectAllWrapper);
+ $('#issue-filters, #issue-actions').filter(':visible').find('.column:first').prepend($issueSelectAll);
};
$issueCheckboxes.on('change', syncIssueSelectionState);
let action = this.getAttribute('data-action');
let elementId = this.getAttribute('data-element-id');
const url = this.getAttribute('data-url');
- const issueIDs = $('.issue-checkbox').children('input:checked').map((_, el) => {
+ const issueIDs = $('.issue-checkbox:checked').map((_, el) => {
return el.getAttribute('data-issue-id');
}).get().join(',');
if (elementId === '0' && url.slice(-9) === '/assignee') {
issueIDs,
elementId
).then(() => {
- // 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((_, e) => { e.checked = false });
- }
window.location.reload();
});
});
-
- // NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay
- // checked after reload trigger checked event, if checkboxes are checked on load
- $('.issue-checkbox input[type="checkbox"]:checked').first().each((_, e) => {
- e.checked = false;
- $(e).trigger('click');
- });
}