Tear down the beforeUnload handler when redirecting after page creation

Change-Id: If182eb62068c3c585a98535cc6761d98ad7dd56d
This commit is contained in:
Catrope 2012-06-21 12:41:39 -07:00
parent f35c8adac8
commit fba013bedf

View file

@ -192,6 +192,7 @@ ve.init.ViewPageTarget.prototype.onLoadError = function( response, status, error
ve.init.ViewPageTarget.prototype.onSave = function( html ) {
if ( Number( mw.config.get( 'wgArticleId', 0 ) ) === 0 ) {
// This is a page creation, refresh the page
this.teardownBeforeUnloadHandler();
window.location.href = this.viewUri;
} else {
// Update watch link to match 'watch checkbox' in save dialog.