From fba013bedf365b9313fdf8684c4494f76bb381cf Mon Sep 17 00:00:00 2001 From: Catrope Date: Thu, 21 Jun 2012 12:41:39 -0700 Subject: [PATCH] Tear down the beforeUnload handler when redirecting after page creation Change-Id: If182eb62068c3c585a98535cc6761d98ad7dd56d --- modules/ve/init/targets/ve.init.ViewPageTarget.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ve/init/targets/ve.init.ViewPageTarget.js b/modules/ve/init/targets/ve.init.ViewPageTarget.js index 13a9bad610..ba55333a70 100644 --- a/modules/ve/init/targets/ve.init.ViewPageTarget.js +++ b/modules/ve/init/targets/ve.init.ViewPageTarget.js @@ -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.