mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-23 16:51:32 +01:00
Improve consistency in wp.Uploader callbacks; pass file objects to all handlers. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
16b01d701e
commit
c2e9648620
@ -130,7 +130,9 @@ if ( typeof wp === 'undefined' )
|
|||||||
$('#' + this.uploader.id + '_html5_container').hide();
|
$('#' + this.uploader.id + '_html5_container').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.uploader.bind( 'UploadProgress', this.progress );
|
this.uploader.bind( 'UploadProgress', function( up, file ) {
|
||||||
|
self.progress( file );
|
||||||
|
});
|
||||||
|
|
||||||
this.uploader.bind( 'FileUploaded', function( up, file, response ) {
|
this.uploader.bind( 'FileUploaded', function( up, file, response ) {
|
||||||
try {
|
try {
|
||||||
@ -143,10 +145,10 @@ if ( typeof wp === 'undefined' )
|
|||||||
return self.error( pluploadL10n.default_error );
|
return self.error( pluploadL10n.default_error );
|
||||||
|
|
||||||
if ( 'error' === response.type )
|
if ( 'error' === response.type )
|
||||||
return self.error( response.data.message, response.data );
|
return self.error( response.data.message, response.data, file );
|
||||||
|
|
||||||
if ( 'success' === response.type )
|
if ( 'success' === response.type )
|
||||||
return self.success( response.data );
|
return self.success( response.data, file );
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -162,7 +164,7 @@ if ( typeof wp === 'undefined' )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.error( message, error );
|
self.error( message, error, error.file );
|
||||||
up.refresh();
|
up.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user