From d1bf196f68ab46e606153a954acb13a9254f0f98 Mon Sep 17 00:00:00 2001 From: Prateek Saxena Date: Wed, 14 Oct 2015 15:14:17 +0530 Subject: [PATCH] Media upload: Initialize booklet before setting file on drag drop Calling initialize will clear all fields including the OO.ui.SelectFileWidget that was just set. Follows up I521909d27c390faad7d62f717f2b97b7676e5a63. Bug: T40031 Change-Id: Ibc7ddafae9cb7718372520245a356938f4731479 --- modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ); };