@@ -3,9 +3,8 @@ import {updateIssuesMeta} from './repo-issue.js';
3
3
import { toggleElem } from '../utils/dom.js' ;
4
4
5
5
export function initCommonIssue ( ) {
6
- const $issueSelectAllWrapper = $ ( '.issue-checkbox-all' ) ;
7
- const $issueSelectAll = $ ( '.issue-checkbox-all input' ) ;
8
- const $issueCheckboxes = $ ( '.issue-checkbox input' ) ;
6
+ const $issueSelectAll = $ ( '.issue-checkbox-all' ) ;
7
+ const $issueCheckboxes = $ ( '.issue-checkbox' ) ;
9
8
10
9
const syncIssueSelectionState = ( ) => {
11
10
const $checked = $issueCheckboxes . filter ( ':checked' ) ;
@@ -23,7 +22,7 @@ export function initCommonIssue() {
23
22
toggleElem ( $ ( '#issue-filters' ) , ! anyChecked ) ;
24
23
toggleElem ( $ ( '#issue-actions' ) , anyChecked ) ;
25
24
// there are two panels but only one select-all checkbox, so move the checkbox to the visible panel
26
- $ ( '#issue-filters, #issue-actions' ) . filter ( ':visible' ) . find ( '.column:first' ) . prepend ( $issueSelectAllWrapper ) ;
25
+ $ ( '#issue-filters, #issue-actions' ) . filter ( ':visible' ) . find ( '.column:first' ) . prepend ( $issueSelectAll ) ;
27
26
} ;
28
27
29
28
$issueCheckboxes . on ( 'change' , syncIssueSelectionState ) ;
@@ -38,7 +37,7 @@ export function initCommonIssue() {
38
37
let action = this . getAttribute ( 'data-action' ) ;
39
38
let elementId = this . getAttribute ( 'data-element-id' ) ;
40
39
const url = this . getAttribute ( 'data-url' ) ;
41
- const issueIDs = $ ( '.issue-checkbox' ) . children ( 'input :checked') . map ( ( _ , el ) => {
40
+ const issueIDs = $ ( '.issue-checkbox:checked' ) . map ( ( _ , el ) => {
42
41
return el . getAttribute ( 'data-issue-id' ) ;
43
42
} ) . get ( ) . join ( ',' ) ;
44
43
if ( elementId === '0' && url . slice ( - 9 ) === '/assignee' ) {
@@ -54,20 +53,7 @@ export function initCommonIssue() {
54
53
issueIDs ,
55
54
elementId
56
55
) . then ( ( ) => {
57
- // NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the
58
- // checkboxes stay checked after reload
59
- if ( action === 'close' || action === 'open' ) {
60
- // uncheck all checkboxes
61
- $ ( '.issue-checkbox input[type="checkbox"]' ) . each ( ( _ , e ) => { e . checked = false } ) ;
62
- }
63
56
window . location . reload ( ) ;
64
57
} ) ;
65
58
} ) ;
66
-
67
- // NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay
68
- // checked after reload trigger checked event, if checkboxes are checked on load
69
- $ ( '.issue-checkbox input[type="checkbox"]:checked' ) . first ( ) . each ( ( _ , e ) => {
70
- e . checked = false ;
71
- $ ( e ) . trigger ( 'click' ) ;
72
- } ) ;
73
59
}
0 commit comments