mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
If VE was opened on action=edit URL, redirect to view URL when closing
We already do it after save, but not if the editor is closed without saving. This behavior is a bit awkward for non-existent pages (redlinks), since MediaWiki normally doesn't display them in view mode (all links point to action=edit). But this seems less weird than not allowing the editor to be closed. Bug: T122388 Bug: T168338 Change-Id: Id9ee41356f011dfbfa6e8744b8d9076f8eacaf39
This commit is contained in:
parent
e9f4ebde0f
commit
37e349913e
|
@ -675,6 +675,12 @@ ve.init.mw.DesktopArticleTarget.prototype.teardown = function ( trackMechanism )
|
|||
.removeClass( 've-init-mw-desktopArticleTarget-uneditableContent' );
|
||||
|
||||
mw.hook( 've.deactivationComplete' ).fire( target.edited );
|
||||
|
||||
if ( !target.isViewPage ) {
|
||||
location.href = target.viewUri.clone().extend( {
|
||||
redirect: mw.config.get( 'wgIsRedirect' ) ? 'no' : undefined
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue