File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed
www/core/components/fileuploader/services Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -247,25 +247,25 @@ angular.module('mm.core.fileuploader')
247247 if ( ! uploadFileScope ) {
248248 // Create a scope for the on change directive.
249249 uploadFileScope = $rootScope . $new ( ) ;
250+ }
250251
251- uploadFileScope . filePicked = function ( evt ) {
252- var input = evt . srcElement ;
253- var file = input . files [ 0 ] ;
254- input . value = '' ; // Unset input.
255- if ( ! file ) {
256- return ;
252+ uploadFileScope . filePicked = function ( evt ) {
253+ var input = evt . srcElement ;
254+ var file = input . files [ 0 ] ;
255+ input . value = '' ; // Unset input.
256+ if ( ! file ) {
257+ return ;
258+ }
259+
260+ // Upload the picked file.
261+ $mmFileUploaderHelper . uploadFileObject ( file , maxSize , upload , allowOffline ) . then ( function ( result ) {
262+ $mmFileUploaderHelper . fileUploaded ( result ) ;
263+ } ) . catch ( function ( error ) {
264+ if ( error ) {
265+ $mmUtil . showErrorModal ( error ) ;
257266 }
258-
259- // Upload the picked file.
260- $mmFileUploaderHelper . uploadFileObject ( file , maxSize , upload , allowOffline ) . then ( function ( result ) {
261- $mmFileUploaderHelper . fileUploaded ( result ) ;
262- } ) . catch ( function ( error ) {
263- if ( error ) {
264- $mmUtil . showErrorModal ( error ) ;
265- }
266- } ) ;
267- } ;
268- }
267+ } ) ;
268+ } ;
269269
270270 $compile ( input ) ( uploadFileScope ) ;
271271
You can’t perform that action at this time.
0 commit comments