Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/205106

Change subject: Only auto-close windows which are not the one we are trying to 
open
......................................................................

Only auto-close windows which are not the one we are trying to open

This was causing the findNext command (F3/Ctrl+G) to close & open
the find dialog.

Change-Id: I61d418d292f2cc9f0a941997b08d66e69b4359f8
---
M src/ui/actions/ve.ui.WindowAction.js
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/06/205106/1

diff --git a/src/ui/actions/ve.ui.WindowAction.js 
b/src/ui/actions/ve.ui.WindowAction.js
index 7f38445..6e571f4 100644
--- a/src/ui/actions/ve.ui.WindowAction.js
+++ b/src/ui/actions/ve.ui.WindowAction.js
@@ -48,6 +48,7 @@
        var currentInspector, inspectorWindowManager,
                windowType = this.getWindowType( name ),
                windowManager = windowType && this.getWindowManager( windowType 
),
+               currentWindow = windowManager.getCurrentWindow(),
                autoClosePromises = [],
                surface = this.surface,
                fragment = surface.getModel().getFragment( undefined, true ),
@@ -61,8 +62,12 @@
        data = ve.extendObject( { dir: dir }, data, { fragment: fragment } );
        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
-               autoClosePromises.push( windowManager.closeWindow( 
windowManager.getCurrentWindow() ) );
+               if ( currentWindow && currentWindow.constructor.static.name !== 
name ) {
+                       autoClosePromises.push( windowManager.closeWindow( 
currentWindow ) );
+               }
        }
 
        // If we're opening a dialog, close all inspectors first

-- 
To view, visit https://gerrit.wikimedia.org/r/205106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61d418d292f2cc9f0a941997b08d66e69b4359f8
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to