NWE: Don't show button to switch to VE if it isn't available

Bug: T146182
Change-Id: I4bd039726ebccfd4351ecc68e6d7662752412d1b
This commit is contained in:
Alex Monk 2016-09-24 02:43:38 +01:00
parent c0cf9c1e75
commit d0abe11aca

View file

@ -149,7 +149,11 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.setupToolbar = function ( surf
actionGroups[ 1 ].include, actionGroups[ 1 ].include,
[ 'meta', 'settings', 'advancedSettings', 'categories', 'languages' ] [ '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 ); this.getActions().setup( actionGroups, surface );
} }
}; };