From 0791dd352db3a15e5a6ffb82e49d8bc8270c206c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 26 Jan 2020 19:31:20 +0100 Subject: [PATCH] Fix tab initialization if NWE is enabled but VE is disabled Bug: T178976 Change-Id: I16b7ef564e8c28c0c583c724ffb482b2c9fcbadb --- .../ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js index ae7461b9f0..b0905f55b7 100644 --- a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js @@ -585,18 +585,18 @@ } // Set up the tabs appropriately if the user has VE on - if ( init.isAvailable && enabledForUser ) { + if ( init.isAvailable ) { // … on two-edit-tab wikis, or single-edit-tab wikis, where the user wants both … - if ( !init.isSingleEditTab ) { + if ( !init.isSingleEditTab && init.isVisualAvailable && enabledForUser ) { // … set the skin up with both tabs and both section edit links. init.setupMultiTabSkin(); } else if ( pageCanLoadEditor && ( - ( init.isVisualAvailable && isOnlyTabVE() ) || + ( init.isVisualAvailable && enabledForUser && isOnlyTabVE() ) || ( init.isWikitextAvailable && isOnlyTabWikitext() ) ) ) { - // … on single-edit-tab wikis, where VE is the user's preferred editor + // … on single-edit-tab wikis, where VE or NWE is the user's preferred editor // Handle section edit link clicks $( '.mw-editsection a' ).off( '.ve-target' ).on( 'click.ve-target', function ( e ) { // isOnlyTabVE is computed on click as it may have changed since load