@@ -49,45 +49,47 @@ function initRepoIssueListCheckboxes() {
4949 syncIssueSelectionState ( ) ;
5050 } ) ;
5151
52- queryElems ( document , '.issue-action' , ( el ) => el . addEventListener ( 'click' , async ( e : MouseEvent ) => {
53- e . preventDefault ( ) ;
54-
55- const url = el . getAttribute ( 'data-url' ) ;
56- let action = el . getAttribute ( 'data-action' ) ;
57- let elementId = el . getAttribute ( 'data-element-id' ) ;
58- const issueIDList = [ ] ;
59- for ( const el of document . querySelectorAll ( '.issue-checkbox:checked' ) ) {
60- issueIDList . push ( el . getAttribute ( 'data-issue-id' ) ) ;
61- }
62- const issueIDs = issueIDList . join ( ',' ) ;
63- if ( ! issueIDs ) return ;
52+ queryElems ( document , '.issue-action' , ( el ) => el . addEventListener ( 'click' ,
53+ async ( e : MouseEvent ) => {
54+ e . preventDefault ( ) ;
55+
56+ const url = el . getAttribute ( 'data-url' ) ;
57+ let action = el . getAttribute ( 'data-action' ) ;
58+ let elementId = el . getAttribute ( 'data-element-id' ) ;
59+ const issueIDList : string [ ] = [ ] ;
60+ for ( const el of document . querySelectorAll ( '.issue-checkbox:checked' ) ) {
61+ issueIDList . push ( el . getAttribute ( 'data-issue-id' ) ) ;
62+ }
63+ const issueIDs = issueIDList . join ( ',' ) ;
64+ if ( ! issueIDs ) return ;
6465
65- // for assignee
66- if ( elementId === '0' && url . endsWith ( '/assignee' ) ) {
67- elementId = '' ;
68- action = 'clear' ;
69- }
66+ // for assignee
67+ if ( elementId === '0' && url . endsWith ( '/assignee' ) ) {
68+ elementId = '' ;
69+ action = 'clear' ;
70+ }
7071
71- // for toggle
72- if ( action === 'toggle' && e . altKey ) {
73- action = 'toggle-alt' ;
74- }
72+ // for toggle
73+ if ( action === 'toggle' && e . altKey ) {
74+ action = 'toggle-alt' ;
75+ }
7576
76- // for delete
77- if ( action === 'delete' ) {
78- const confirmText = el . getAttribute ( 'data-action-delete-confirm' ) ;
79- if ( ! await confirmModal ( { content : confirmText , confirmButtonColor : 'red' } ) ) {
80- return ;
77+ // for delete
78+ if ( action === 'delete' ) {
79+ const confirmText = el . getAttribute ( 'data-action-delete-confirm' ) ;
80+ if ( ! await confirmModal ( { content : confirmText , confirmButtonColor : 'red' } ) ) {
81+ return ;
82+ }
8183 }
82- }
8384
84- try {
85- await updateIssuesMeta ( url , action , issueIDs , elementId ) ;
86- window . location . reload ( ) ;
87- } catch ( err ) {
88- showErrorToast ( err . responseJSON ?. error ?? err . message ) ;
89- }
90- } ) ) ;
85+ try {
86+ await updateIssuesMeta ( url , action , issueIDs , elementId ) ;
87+ window . location . reload ( ) ;
88+ } catch ( err ) {
89+ showErrorToast ( err . responseJSON ?. error ?? err . message ) ;
90+ }
91+ } ,
92+ ) ) ;
9193}
9294
9395function initDropdownUserRemoteSearch ( el : Element ) {
0 commit comments