jenkins-bot has submitted this change and it was merged.
Change subject: VESwitchConfirmDialog: Use modes to hide 'keep' button
......................................................................
VESwitchConfirmDialog: Use modes to hide 'keep' button
Change-Id: I92110ea14ded335db330721c08314c7a20169886
(cherry picked from commit 28a5d0db84324756139e00395bfd4a61d5f9060a)
---
M modules/ve-mw/ui/dialogs/ve.ui.MWVESwitchConfirmDialog.js
1 file changed, 12 insertions(+), 11 deletions(-)
Approvals:
Esanders: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWVESwitchConfirmDialog.js
b/modules/ve-mw/ui/dialogs/ve.ui.MWVESwitchConfirmDialog.js
index 95dc105..b94e5c1 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWVESwitchConfirmDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWVESwitchConfirmDialog.js
@@ -43,12 +43,20 @@
{
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 @@
* @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 );
};
--
To view, visit https://gerrit.wikimedia.org/r/250747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I92110ea14ded335db330721c08314c7a20169886
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.27.0-wmf.5
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits