Merge "Disallow switching in NWE welcome dialog if VE should be unavailable"

This commit is contained in:
jenkins-bot 2020-02-03 23:59:10 +00:00 committed by Gerrit Code Review
commit 48da3746f8

View file

@ -2074,7 +2074,7 @@ ve.init.mw.ArticleTarget.prototype.getSectionFragmentFromPage = function ( conte
* Show the beta dialog as needed
*/
ve.init.mw.ArticleTarget.prototype.maybeShowWelcomeDialog = function () {
var usePrefs, prefSaysShow, urlSaysHide,
var usePrefs, prefSaysShow, urlSaysHide, editorMode,
windowManager = this.getSurface().dialogs,
target = this;
@ -2102,13 +2102,14 @@ ve.init.mw.ArticleTarget.prototype.maybeShowWelcomeDialog = function () {
)
)
) {
editorMode = this.getDefaultMode();
this.welcomeDialog = new mw.libs.ve.WelcomeDialog();
windowManager.addWindows( [ this.welcomeDialog ] );
windowManager.openWindow(
this.welcomeDialog,
{
switchable: true,
editor: this.getDefaultMode()
switchable: editorMode === 'source' ? this.isModeAvailable( 'visual' ) : true,
editor: editorMode
}
)
.closed.then( function ( data ) {