Navigation Menu

Skip to content

Commit

Permalink
Merge pull request jashkenas#599 from walmartlabs/root-handling
Browse files Browse the repository at this point in the history
Fix root prefix handling in navigate.
  • Loading branch information
jashkenas committed Sep 14, 2011
2 parents 6ed5e45 + b20f54f commit 291863d
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 291863d

Please sign in to comment.