Skip to content

Commit

Permalink
Fix root prefix handling in navigate.
Browse files Browse the repository at this point in the history
Fixes prefix removal when the root prefix is included as part of the navigate route parameter.
  • Loading branch information
kpdecker committed Sep 8, 2011
1 parent 16f4857 commit b20f54f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backbone.js
Expand Up @@ -761,12 +761,13 @@
fragment = window.location.pathname;
var search = window.location.search;
if (search) fragment += search;
if (fragment.indexOf(this.options.root) == 0) fragment = fragment.substr(this.options.root.length);
} else {
fragment = window.location.hash;
}
}
return decodeURIComponent(fragment.replace(hashStrip, ''));
fragment = decodeURIComponent(fragment.replace(hashStrip, ''));
if (!fragment.indexOf(this.options.root)) fragment = fragment.substr(this.options.root.length);
return fragment;
},

// Start the hash change handling, returning `true` if the current URL matches
Expand Down

0 comments on commit b20f54f

Please sign in to comment.