Alex Monk has uploaded a new change for review.

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

Change subject: Don't change focus to VE surface if we're opening the SET dialog
......................................................................

Don't change focus to VE surface if we're opening the SET dialog

Bug: T130552
Change-Id: Idc4639bb3f51690a827bdbdb0419e9303dd39a1b
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 12 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/81/279081/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index a789f1f..d3c04ea 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -45,6 +45,7 @@
        this.checkboxesByName = null;
        this.$otherFields = null;
        this.suppressNormalStartupDialogs = false;
+       this.editingTabDialog = null;
 
        // If this is true then #transformPage / #restorePage will not call 
pushState
        // This is to avoid adding a new history entry for the url we just got 
from onpopstate
@@ -248,7 +249,7 @@
  * @inheritdoc
  */
 ve.init.mw.DesktopArticleTarget.prototype.loadSuccess = function ( response ) {
-       var $checkboxes, defaults, data, windowManager, editingTabDialog,
+       var $checkboxes, defaults, data, windowManager,
                target = this;
 
        // Parent method
@@ -259,9 +260,9 @@
                // Set up a temporary window manager
                windowManager = new OO.ui.WindowManager();
                $( 'body' ).append( windowManager.$element );
-               editingTabDialog = new mw.libs.ve.EditingTabDialog();
-               windowManager.addWindows( [ editingTabDialog ] );
-               windowManager.openWindow( editingTabDialog, { message: mw.msg(
+               this.editingTabDialog = new mw.libs.ve.EditingTabDialog();
+               windowManager.addWindows( [ this.editingTabDialog ] );
+               windowManager.openWindow( this.editingTabDialog, { message: 
mw.msg(
                        'visualeditor-editingtabdialog-body'
                ) } )
                        .then( function ( opened ) { return opened; } )
@@ -411,10 +412,12 @@
                $( 'html' ).removeClass( 've-loading' ).addClass( 
've-activating' );
                $.when( this.activatingDeferred, this.toolbarSetupDeferred 
).done( function () {
                        $( 'html' ).removeClass( 've-activating' ).addClass( 
've-active' );
-                       // We have to focus the page after hiding the original 
content, otherwise
-                       // in firefox the contentEditable container was below 
the view page, and
-                       // 'focus' scrolled the screen down.
-                       target.getSurface().getView().focus();
+                       if ( !target.editingTabDialog ) {
+                               // We have to focus the page after hiding the 
original content, otherwise
+                               // in firefox the contentEditable container was 
below the view page, and
+                               // 'focus' scrolled the screen down.
+                               target.getSurface().getView().focus();
+                       }
                } ).fail( function () {
                        $( 'html' ).removeClass( 've-activating' );
                } );
@@ -469,6 +472,7 @@
        if ( this.welcomeDialog ) {
                this.welcomeDialog.close();
        }
+       this.editingTabDialog = null;
 
        if ( noDialog || this.activating || !this.edited ) {
                this.cancel( trackMechanism );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc4639bb3f51690a827bdbdb0419e9303dd39a1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to