diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index b17291f0b7..e39fba722d 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -1086,13 +1086,13 @@ ve.ui.MWMediaDialog.prototype.getSetupProcess = function ( data ) { this.switchPanels( this.selectedNode ? 'edit' : 'search' ); + // Reset upload booklet + this.mediaUploadBooklet.initialize(); + if ( data.file ) { this.searchTabs.setCard( 'upload' ); this.mediaUploadBooklet.setFile( data.file ); } - - // Reset upload booklet - this.mediaUploadBooklet.initialize(); }, this ); };