mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-24 14:27:56 -05:00
Fix root prefix handling in navigate.
Fixes prefix removal when the root prefix is included as part of the navigate route parameter.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user