File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -254,8 +254,7 @@ define([
254
254
var files ;
255
255
if ( dropOrForm === 'drop' ) {
256
256
files = event . originalEvent . dataTransfer . files ;
257
- } else
258
- {
257
+ } else {
259
258
files = event . originalEvent . target . files ;
260
259
}
261
260
@@ -275,12 +274,11 @@ define([
275
274
} ) ;
276
275
} ;
277
276
278
- for ( var i = 0 ; i < files . length ; i ++ ) {
279
- var f = files [ i ] ;
277
+ Array . from ( files ) . forEach ( function ( f ) {
280
278
var name_and_ext = utils . splitext ( f . name ) ;
281
279
var file_ext = name_and_ext [ 1 ] ;
282
280
283
- if ( f . size > this . _max_upload_size_mb * 1024 * 1024 ) {
281
+ if ( f . size > that . _max_upload_size_mb * 1024 * 1024 ) {
284
282
var body_msg = i18n . msg . sprintf ( i18n . msg . _ ( "The file size is %d MB. Do you still want to upload it?" ) ,
285
283
Math . round ( f . size / ( 1024 * 1024 ) ) ) ;
286
284
dialog . modal ( {
@@ -314,7 +312,7 @@ define([
314
312
reader . onload = reader_onload ;
315
313
reader . onerror = reader_onerror ;
316
314
}
317
- }
315
+ } ) ;
318
316
// Replace the file input form wth a clone of itself. This is required to
319
317
// reset the form. Otherwise, if you upload a file, delete it and try to
320
318
// upload it again, the changed event won't fire.
You can’t perform that action at this time.
0 commit comments