Skip to content

Commit

Permalink
issue-1484: start controller replace history
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Mar 23, 2017
1 parent 31b2322 commit 87dc378
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/core/js/startController.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ define([
setStartLocation: function() {
if (!this.isEnabled()) return;

window.location.hash = this.getStartHash();
var hash = this.getStartHash();

if ('replaceState' in window.history) {
window.history.replaceState('', '', hash);
} else {
// < ie9
if (window.location.hash !== hash) window.history.back();

This comment has been minimized.

Copy link
@brian-learningpool

brian-learningpool Mar 27, 2017

Member

Should there be braces here?

This comment has been minimized.

Copy link
@oliverfoster

oliverfoster Mar 27, 2017

Author Member

this has since been replaced with a different method. sorry, too many commits in quick succession.

window.location.hash = newhash;
}

},

getStartHash: function(alwaysForce) {
Expand Down Expand Up @@ -90,4 +99,4 @@ define([

return StartController;

});
});

0 comments on commit 87dc378

Please sign in to comment.