mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
VESwitchConfirmDialog: Use modes to hide 'keep' button
Change-Id: I92110ea14ded335db330721c08314c7a20169886
This commit is contained in:
parent
07c6c17e5c
commit
28a5d0db84
|
@ -43,12 +43,20 @@ ve.ui.MWVESwitchConfirmDialog.static.actions = [
|
|||
{
|
||||
action: 'cancel',
|
||||
label: mw.msg( 'visualeditor-mweditmodesource-warning-cancel' ),
|
||||
flags: [ 'safe', 'back' ]
|
||||
flags: [ 'safe', 'back' ],
|
||||
modes: [ 'restbase', 'simple' ]
|
||||
},
|
||||
{
|
||||
action: 'discard',
|
||||
label: mw.msg( 'visualeditor-mweditmodesource-warning-switch-discard' ),
|
||||
flags: 'destructive'
|
||||
flags: 'destructive',
|
||||
modes: [ 'restbase', 'simple' ]
|
||||
},
|
||||
{
|
||||
action: 'keep',
|
||||
label: mw.msg( 'visualeditor-mweditmodesource-warning-switch' ),
|
||||
flags: [ 'progressive', 'primary' ],
|
||||
modes: [ 'restbase' ]
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -58,16 +66,9 @@ ve.ui.MWVESwitchConfirmDialog.static.actions = [
|
|||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWVESwitchConfirmDialog.prototype.getSetupProcess = function () {
|
||||
return ve.ui.MWVESwitchConfirmDialog.super.prototype.getSetupProcess
|
||||
.apply( this, arguments )
|
||||
return ve.ui.MWVESwitchConfirmDialog.super.prototype.getSetupProcess.apply( this, arguments )
|
||||
.next( function () {
|
||||
if ( mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl ) {
|
||||
this.getActions().add( [ new OO.ui.ActionWidget( {
|
||||
action: 'keep',
|
||||
label: mw.msg( 'visualeditor-mweditmodesource-warning-switch' ),
|
||||
flags: [ 'progressive', 'primary' ]
|
||||
} ) ] );
|
||||
}
|
||||
this.actions.setMode( mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl ? 'restbase' : 'simple' );
|
||||
}, this );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue