ve.init.MWWelcomeDialog: Don't mess with the actions dynamically

This removes an "ew" comment, which I presume indicates a hack.

Change-Id: I57dfb173d5f37466686f3f9dd9c97a5e7d685199
This commit is contained in:
Bartosz Dziewoński 2016-05-31 23:15:43 +02:00
parent 3dfd203d1b
commit adffe3788c

View file

@ -51,7 +51,7 @@ mw.libs.ve.WelcomeDialog.static.actions = [
action: 'accept',
label: OO.ui.deferMsg( 'visualeditor-welcomedialog-action' ),
flags: [ 'progressive', 'primary' ],
modes: [ 've', 'wte' ]
modes: [ 've', 'wte', 'noswitch' ]
}
];
@ -84,12 +84,7 @@ mw.libs.ve.WelcomeDialog.prototype.getSetupProcess = function ( data ) {
* @inheritdoc
*/
mw.libs.ve.WelcomeDialog.prototype.getReadyProcess = function () {
if ( !this.switchable ) {
// ew
this.actions.remove( this.actions.get( { actions: 'switch-wte' } ) );
this.actions.remove( this.actions.get( { actions: 'switch-ve' } ) );
}
this.actions.setMode( this.editor );
this.actions.setMode( this.switchable ? this.editor : 'noswitch' );
return mw.libs.ve.WelcomeDialog.super.prototype.getReadyProcess.apply( this, arguments );
};