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

This commit is contained in:
jenkins-bot 2015-12-14 17:14:41 +00:00 committed by Gerrit Code Review
commit d750417545

View file

@ -773,11 +773,13 @@
mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' && mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' &&
userPrefEnabled userPrefEnabled
) { ) {
loadVEInPage = mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' || loadVEInPage = pageCanLoadVE && (
mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' ||
( (
getLastEditor() !== 'wikitext' && getLastEditor() !== 'wikitext' &&
mw.user.options.get( 'visualeditor-tabs' ) !== 'prefer-wt' mw.user.options.get( 'visualeditor-tabs' ) !== 'prefer-wt'
); )
);
// Handle section edit link clicks // Handle section edit link clicks
$( '.mw-editsection a' ).on( 'click', function ( e ) { $( '.mw-editsection a' ).on( 'click', function ( e ) {
if ( loadVEInPage ) { if ( loadVEInPage ) {