Take pageCanLoadVE into account when figuring out whether VE will load in-page or not

Bug: T121342
Change-Id: I84ade6e2ab062597fbfd859a90a864c7607547da
This commit is contained in:
Alex Monk 2015-12-14 16:58:26 +00:00
parent 648457ca4c
commit 774034b553

View file

@ -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 ) {