From e9153fdccf2cb3731259e73d0e2fd11ebf2d37ce Mon Sep 17 00:00:00 2001 From: Krenair Date: Mon, 14 Apr 2014 17:19:30 +0100 Subject: [PATCH] Always replace state with VE tag when loading Instead of just when venotify is used. To stop the back button breaking. Bug: 63739 Change-Id: I637818f34a9015076c85c6daccb337503ad2499d --- .../ve-mw/init/targets/ve.init.mw.ViewPageTarget.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index a858ac5333..2f8f8e781a 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -135,10 +135,15 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() { new mw.Title( this.pageName ).toText() ) } ); - if ( window.history.replaceState ) { - delete currentUri.query.venotify; - window.history.replaceState( this.popState, document.title, currentUri ); - } + + delete currentUri.query.venotify; + } + + if ( window.history.replaceState ) { + // This is to stop the back button breaking when it's supposed to take us back out + // of VE. It used to only be called when venotify is used. FIXME: there should be + // a much better solution than this. + window.history.replaceState( this.popState, document.title, currentUri ); } this.setupSkinTabs();