mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Ensure veswitched is not set when we set wteswitched in the URI
veswitched and wteswitched together cannot result in any sane behaviour. To reproduce: * Open VE (while having multi-tab pref?), switch into WTE * Make a change * Switch into VE Change-Id: I90e19169e3fab60ab876c8e4d349801309db262f
This commit is contained in:
parent
1ad77ddf91
commit
373a19f1cc
|
@ -567,11 +567,14 @@
|
||||||
.then( function ( opened ) { return opened; } )
|
.then( function ( opened ) { return opened; } )
|
||||||
.then( function ( closing ) { return closing; } )
|
.then( function ( closing ) { return closing; } )
|
||||||
.then( function ( data ) {
|
.then( function ( data ) {
|
||||||
|
var oldUri;
|
||||||
if ( data && data.action === 'keep' ) {
|
if ( data && data.action === 'keep' ) {
|
||||||
activatePageTarget( true );
|
activatePageTarget( true );
|
||||||
} else if ( data && data.action === 'discard' ) {
|
} else if ( data && data.action === 'discard' ) {
|
||||||
setEditorPreference( 'visualeditor' );
|
setEditorPreference( 'visualeditor' );
|
||||||
location.href = veEditUri.clone().extend( { wteswitched: 1 } );
|
oldUri = veEditUri.clone();
|
||||||
|
delete oldUri.query.veswitched;
|
||||||
|
location.href = oldUri.extend( { wteswitched: 1 } );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue