File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import { createSortable } from '../modules/sortable.ts' ;
22import { POST } from '../modules/fetch.ts' ;
33import { showErrorToast } from '../modules/toast.ts' ;
4+ import { queryElemChildren } from '../utils/dom.ts' ;
45
56export function initRepoBranchesSettings ( ) {
67 const protectedBranchesList = document . querySelector ( '#protected-branches-list' ) ;
@@ -12,10 +13,8 @@ export function initRepoBranchesSettings() {
1213
1314 onEnd : ( ) => {
1415 ( async ( ) => {
15- const itemIds = Array . from ( protectedBranchesList . children , ( item ) => {
16- const id = item . getAttribute ( 'data-id' ) ;
17- return parseInt ( id ) ;
18- } ) ;
16+ const itemElems = queryElemChildren ( protectedBranchesList , '.item[data-id]' ) ;
17+ const itemIds = Array . from ( itemElems , ( el ) => el . getAttribute ( 'data-id' ) ) ;
1918
2019 try {
2120 await POST ( protectedBranchesList . getAttribute ( 'data-update-priority-url' ) , {
You can’t perform that action at this time.
0 commit comments