User:Yaron Koren/ReloadAfterVEEdit.js
/**
* VisualEditor does not reload the page after a save, but simply modifies the DOM - so any
* custom JavaScript for that page will not get called again. This code reloads the page after
* any such save.
*
* @author Yaron Koren
*/
mw.hook( 'postEdit' ).add( function () {
if ( ve && ve.init && ve.init.articleTarget && ve.init.articleTarget.teardownUnloadHandlers ) {
ve.init.articleTarget.teardownUnloadHandlers();
location.replace( location.href );
}
});