File tree 3 files changed +14
-19
lines changed
3 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ rules:
296
296
jquery/no-delegate : [2]
297
297
jquery/no-each : [0]
298
298
jquery/no-extend : [2]
299
- jquery/no-fade : [0 ]
299
+ jquery/no-fade : [2 ]
300
300
jquery/no-filter : [0]
301
301
jquery/no-find : [0]
302
302
jquery/no-global-eval : [2]
@@ -309,7 +309,7 @@ rules:
309
309
jquery/no-is-function : [2]
310
310
jquery/no-is : [0]
311
311
jquery/no-load : [2]
312
- jquery/no-map : [0 ]
312
+ jquery/no-map : [2 ]
313
313
jquery/no-merge : [2]
314
314
jquery/no-param : [2]
315
315
jquery/no-parent : [0]
@@ -451,7 +451,7 @@ rules:
451
451
no-jquery/no-load : [2]
452
452
no-jquery/no-map-collection : [0]
453
453
no-jquery/no-map-util : [2]
454
- no-jquery/no-map : [0 ]
454
+ no-jquery/no-map : [2 ]
455
455
no-jquery/no-merge : [2]
456
456
no-jquery/no-node-name : [2]
457
457
no-jquery/no-noop : [2]
Original file line number Diff line number Diff line change @@ -14,17 +14,15 @@ export function initRepoEllipsisButton() {
14
14
}
15
15
16
16
export function initRepoCommitLastCommitLoader ( ) {
17
- const entryMap = { } ;
18
-
19
- const entries = $ ( 'table#repo-files-table tr.notready' )
20
- . map ( ( _ , v ) => {
21
- entryMap [ $ ( v ) . attr ( 'data-entryname' ) ] = $ ( v ) ;
22
- return $ ( v ) . attr ( 'data-entryname' ) ;
23
- } )
24
- . get ( ) ;
17
+ const notReadyEls = document . querySelectorAll ( 'table#repo-files-table tr.notready' ) ;
18
+ if ( ! notReadyEls . length ) return ;
25
19
26
- if ( entries . length === 0 ) {
27
- return ;
20
+ const entryMap = { } ;
21
+ const entries = [ ] ;
22
+ for ( const el of notReadyEls ) {
23
+ const entryname = el . getAttribute ( 'data-entryname' ) ;
24
+ entryMap [ entryname ] = $ ( el ) ;
25
+ entries . push ( entryname ) ;
28
26
}
29
27
30
28
const lastCommitLoaderURL = $ ( 'table#repo-files-table' ) . data ( 'lastCommitLoaderUrl' ) ;
Original file line number Diff line number Diff line change @@ -398,17 +398,14 @@ async function onEditContent(event) {
398
398
}
399
399
} ;
400
400
401
- const saveAndRefresh = ( dz , $dropzone ) => {
401
+ const saveAndRefresh = ( dz ) => {
402
402
showElem ( $renderContent ) ;
403
403
hideElem ( $editContentZone ) ;
404
- const $attachments = $dropzone . find ( '.files' ) . find ( '[name=files]' ) . map ( function ( ) {
405
- return $ ( this ) . val ( ) ;
406
- } ) . get ( ) ;
407
404
$ . post ( $editContentZone . attr ( 'data-update-url' ) , {
408
405
_csrf : csrfToken ,
409
406
content : comboMarkdownEditor . value ( ) ,
410
407
context : $editContentZone . attr ( 'data-context' ) ,
411
- files : $attachments ,
408
+ files : dz . files . map ( ( file ) => file . uuid ) ,
412
409
} , ( data ) => {
413
410
if ( ! data . content ) {
414
411
$renderContent . html ( $ ( '#no-content' ) . html ( ) ) ;
@@ -452,7 +449,7 @@ async function onEditContent(event) {
452
449
} ) ;
453
450
$editContentZone . find ( '.save.button' ) . on ( 'click' , ( e ) => {
454
451
e . preventDefault ( ) ;
455
- saveAndRefresh ( dz , $dropzone ) ;
452
+ saveAndRefresh ( dz ) ;
456
453
} ) ;
457
454
} else {
458
455
comboMarkdownEditor = getComboMarkdownEditor ( $editContentZone . find ( '.combo-markdown-editor' ) ) ;
You can’t perform that action at this time.
0 commit comments