From d0abe11aca4e7145fa776f8a5f079f1a2903dbf9 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sat, 24 Sep 2016 02:43:38 +0100 Subject: [PATCH] NWE: Don't show button to switch to VE if it isn't available Bug: T146182 Change-Id: I4bd039726ebccfd4351ecc68e6d7662752412d1b --- .../init/targets/ve.init.mw.DesktopWikitextArticleTarget.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js index bf8cf47309..84b107d41f 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js @@ -149,7 +149,11 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.setupToolbar = function ( surf actionGroups[ 1 ].include, [ 'meta', 'settings', 'advancedSettings', 'categories', 'languages' ] ); - actionGroups[ 2 ].include[ 0 ] = 'editModeVisual'; + if ( mw.libs.ve.isVisualAvailable ) { + actionGroups[ 2 ].include[ 0 ] = 'editModeVisual'; + } else { + actionGroups[ 2 ].include = []; + } this.getActions().setup( actionGroups, surface ); } };