mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Merge "Use correct switch type when opening welcome dialog on NWE"
This commit is contained in:
commit
376a4520ea
|
@ -962,7 +962,7 @@
|
|||
welcomeDialog,
|
||||
{
|
||||
switchable: init.isAvailable,
|
||||
editor: 'wte'
|
||||
editor: 'source'
|
||||
}
|
||||
)
|
||||
.then( function ( opened ) { return opened; } )
|
||||
|
|
|
@ -40,18 +40,18 @@ mw.libs.ve.WelcomeDialog.static.actions = [
|
|||
{
|
||||
action: 'switch-wte',
|
||||
label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch' ),
|
||||
modes: [ 've' ]
|
||||
modes: [ 'visual' ]
|
||||
},
|
||||
{
|
||||
action: 'switch-ve',
|
||||
label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch-ve' ),
|
||||
modes: [ 'wte' ]
|
||||
modes: [ 'source' ]
|
||||
},
|
||||
{
|
||||
action: 'accept',
|
||||
label: OO.ui.deferMsg( 'visualeditor-welcomedialog-action' ),
|
||||
flags: [ 'progressive', 'primary' ],
|
||||
modes: [ 've', 'wte', 'noswitch' ]
|
||||
modes: [ 'visual', 'source', 'noswitch' ]
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -1812,7 +1812,7 @@ ve.init.mw.ArticleTarget.prototype.maybeShowWelcomeDialog = function () {
|
|||
this.welcomeDialog,
|
||||
{
|
||||
switchable: this.constructor.static.trackingName !== 'mobile',
|
||||
editor: 've'
|
||||
editor: this.mode
|
||||
}
|
||||
)
|
||||
.then( function ( opened ) {
|
||||
|
@ -1824,11 +1824,15 @@ ve.init.mw.ArticleTarget.prototype.maybeShowWelcomeDialog = function () {
|
|||
.then( function ( data ) {
|
||||
target.welcomeDialogPromise.resolve();
|
||||
target.welcomeDialog = null;
|
||||
// switchToWikitextEditor and switchToVisualEditor are actually
|
||||
// only defined in subclasses :/
|
||||
if ( data && data.action === 'switch-wte' ) {
|
||||
// TODO: Make this work on mobile - right now we can only
|
||||
// get away with it because the button which triggers this
|
||||
// action is hidden on mobile
|
||||
target.switchToWikitextEditor( true, true );
|
||||
} else if ( data && data.action === 'switch-ve' ) {
|
||||
target.switchToVisualEditor();
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue