jenkins-bot has submitted this change and it was merged. Change subject: Don't wait for fragmentPromise before closing open windows ......................................................................
Don't wait for fragmentPromise before closing open windows Change-Id: I88ac2ffa1d9f1f305d78dcabb71eb3c9d590d55b --- M src/ui/actions/ve.ui.WindowAction.js 1 file changed, 21 insertions(+), 18 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ui/actions/ve.ui.WindowAction.js b/src/ui/actions/ve.ui.WindowAction.js index cb67757..a08fcee 100644 --- a/src/ui/actions/ve.ui.WindowAction.js +++ b/src/ui/actions/ve.ui.WindowAction.js @@ -81,26 +81,29 @@ fragmentPromise = $.Deferred().resolve( fragment ).promise(); } - fragmentPromise.then( function ( fragment ) { - data = ve.extendObject( { dir: dir }, data, { fragment: fragment, $returnFocusTo: $noFocus } ); - if ( windowType === 'toolbar' || windowType === 'inspector' ) { - data = ve.extendObject( data, { surface: surface } ); - // Auto-close the current window if it is different to the one we are - // trying to open. - // TODO: Make auto-close a window manager setting - if ( currentWindow && currentWindow.constructor.static.name !== name ) { - autoClosePromises.push( windowManager.closeWindow( currentWindow ) ); - } - } + data = ve.extendObject( { dir: dir }, data, { $returnFocusTo: $noFocus } ); - // If we're opening a dialog, close all inspectors first - if ( windowType === 'dialog' ) { - inspectorWindowManager = windowAction.getWindowManager( 'inspector' ); - currentInspector = inspectorWindowManager.getCurrentWindow(); - if ( currentInspector ) { - autoClosePromises.push( inspectorWindowManager.closeWindow( currentInspector ) ); - } + if ( windowType === 'toolbar' || windowType === 'inspector' ) { + data = ve.extendObject( data, { surface: surface } ); + // Auto-close the current window if it is different to the one we are + // trying to open. + // TODO: Make auto-close a window manager setting + if ( currentWindow && currentWindow.constructor.static.name !== name ) { + autoClosePromises.push( windowManager.closeWindow( currentWindow ) ); } + } + + // If we're opening a dialog, close all inspectors first + if ( windowType === 'dialog' ) { + inspectorWindowManager = windowAction.getWindowManager( 'inspector' ); + currentInspector = inspectorWindowManager.getCurrentWindow(); + if ( currentInspector ) { + autoClosePromises.push( inspectorWindowManager.closeWindow( currentInspector ) ); + } + } + + fragmentPromise.then( function ( fragment ) { + ve.extendObject( data, { fragment: fragment } ); $.when.apply( $, autoClosePromises ).always( function () { windowManager.getWindow( name ).then( function ( win ) { -- To view, visit https://gerrit.wikimedia.org/r/325114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88ac2ffa1d9f1f305d78dcabb71eb3c9d590d55b Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits