Permalink
Browse files

Merge pull request #599 from walmartlabs/root-handling

Fix root prefix handling in navigate.
  • Loading branch information...
2 parents 6ed5e45 + b20f54f commit 291863df556d4a84cf5b9056f1d8f55c48441084 @jashkenas jashkenas committed Sep 14, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 backbone.js
View
@@ -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

0 comments on commit 291863d

Please sign in to comment.