Don't allow keeping changes when switching from wikitext *section* editing

Bug: T117713
Change-Id: I16f17fa2aa4c9a1b74d8cde072c611e2685f5448
This commit is contained in:
Alex Monk 2015-11-04 16:19:36 +00:00
parent 6341c4a3b5
commit 9c7a058b09

View file

@ -69,7 +69,14 @@ mw.libs.ve.SwitchConfirmDialog.static.actions = [
mw.libs.ve.SwitchConfirmDialog.prototype.getSetupProcess = function () {
return mw.libs.ve.SwitchConfirmDialog.super.prototype.getSetupProcess.apply( this, arguments )
.next( function () {
this.actions.setMode( mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl ? 'restbase' : 'simple' );
if (
mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl &&
!$( 'input[name=wpSection]' ).val()
) {
this.actions.setMode( 'restbase' );
} else {
this.actions.setMode( 'simple' );
}
}, this );
};