From 4210c4bee085e603a3dabe748d4e9e4e6ca8e5cb Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Wed, 30 Mar 2016 02:44:51 +0100 Subject: [PATCH] Use veaction=edit in URL instead of action=edit when we're using multiple tabs TODO: What about prefer-wt users switching from WTE? Bug: T131064 Change-Id: I9aa701cbda3964decb8b1ee853c0a281567a0ccb --- .../init/targets/ve.init.mw.DesktopArticleTarget.init.js | 7 +++++-- .../ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index 518149073b..180b6ce028 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -175,7 +175,7 @@ $( '#ca-edit a' ).text( mw.msg( key ) ); } - if ( uri.query.action !== 'edit' ) { + if ( uri.query.action !== 'edit' && uri.query.veaction !== 'edit' ) { if ( history.pushState ) { // Replace the current state with one that is tagged as ours, to prevent the // back button from breaking when used to exit VE. FIXME: there should be a better @@ -301,7 +301,10 @@ ); // On a view page, extend the current URI so parameters like oldid are carried over // On a non-view page, use viewUri - if ( conf.singleEditTab ) { + if ( + conf.singleEditTab && + mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' + ) { veEditUri = viewUri.clone().extend( { action: 'edit' } ); delete veEditUri.query.veaction; } else { 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 7508482317..d59934af29 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -1114,7 +1114,10 @@ ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () { // Set the current URL uri = this.currentUri; - if ( mw.config.get( 'wgVisualEditorConfig' ).singleEditTab ) { + if ( + mw.config.get( 'wgVisualEditorConfig' ).singleEditTab && + mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' + ) { uri.query.action = 'edit'; mw.config.set( 'wgAction', 'edit' ); } else {