From 774034b55320ebecfc6d8787f4bae7da6a3ba059 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 14 Dec 2015 16:58:26 +0000 Subject: [PATCH] Take pageCanLoadVE into account when figuring out whether VE will load in-page or not Bug: T121342 Change-Id: I84ade6e2ab062597fbfd859a90a864c7607547da --- .../init/targets/ve.init.mw.DesktopArticleTarget.init.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 074babdfd7..9fde9e0462 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 @@ -773,11 +773,13 @@ mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' && userPrefEnabled ) { - loadVEInPage = mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' || + loadVEInPage = pageCanLoadVE && ( + mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' || ( getLastEditor() !== 'wikitext' && mw.user.options.get( 'visualeditor-tabs' ) !== 'prefer-wt' - ); + ) + ); // Handle section edit link clicks $( '.mw-editsection a' ).on( 'click', function ( e ) { if ( loadVEInPage ) {