Skip to content

Commit

Permalink
tweaking transparent URL upgrades.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jul 1, 2011
1 parent 2e1f85d commit 0798d97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,12 @@
this.fragment = fragment;
historyStarted = true;
var started = this.loadUrl() || this.loadUrl(window.location.hash);
if (this._wantsPushState && !this._hasPushState && window.location.pathname != this.options.root) {
var atRoot = window.location.pathname == this.options.root;
if (this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
window.location = this.options.root + '#' + this.fragment;
} else if (this._wantsPushState && this._hasPushState && atRoot && window.location.hash) {
this.navigate(window.location.hash);
} else {
return started;
}
Expand Down

0 comments on commit 0798d97

Please sign in to comment.