From 09a315ca69b42205c7a658f6f22600f69cde021e Mon Sep 17 00:00:00 2001 From: David Lynch Date: Mon, 25 Jun 2018 11:55:51 -0500 Subject: [PATCH] mw.DesktopArticleTarget: remove action=edit when tearing down as single-tab aeb4f2f2b72ad added a #wpTextbox1 to the wikitext surface, which confused our existing teardown check. This confusion only became apparent in single-tab mode, when using the wikitext editor. Bug: T197615 Change-Id: I98e64e7135aaf6f8fda441a91e6cbc4bac6cea39 --- modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7a6fa89dec..fdb203e475 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -1351,7 +1351,8 @@ ve.init.mw.DesktopArticleTarget.prototype.restorePage = function () { } delete uri.query.section; } - if ( 'action' in uri.query && $( '#wpTextbox1' ).length === 0 ) { + if ( 'action' in uri.query && $( '#wpTextbox1:not(.ve-dummyTextbox)' ).length === 0 ) { + // If we're not overlaid on an edit page, remove action=edit delete uri.query.action; mw.config.set( 'wgAction', 'view' ); }