mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Set section to null when switching from NWE to VE
This prevents the discard warning from being shown if the user switches back to NWE then back to VE, as by this point they have left section editing. Change-Id: I734684c54a8900aab3332ed8421cb42f7f845738
This commit is contained in:
parent
1866a8680c
commit
56679dfb35
|
@ -105,6 +105,7 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.switchToVisualEditor = functio
|
||||||
.then( function ( closing ) { return closing; } )
|
.then( function ( closing ) { return closing; } )
|
||||||
.then( function ( data ) {
|
.then( function ( data ) {
|
||||||
if ( data && data.action === 'discard' ) {
|
if ( data && data.action === 'discard' ) {
|
||||||
|
target.section = null;
|
||||||
target.setMode( 'visual' );
|
target.setMode( 'visual' );
|
||||||
target.reloadSurface();
|
target.reloadSurface();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue