Permalink
Browse files

tweaking transparent URL upgrades.

  • Loading branch information...
1 parent 2e1f85d commit 0798d9767224dac51435e149c319a6051dab4843 @jashkenas jashkenas committed Jul 1, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 backbone.js
View
@@ -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;
}

0 comments on commit 0798d97

Please sign in to comment.