Merge pull request #497 from rsim/return_immediately_after_redirect_to_hash_route

return immediately after redirect to hash route
This commit is contained in:
Jeremy Ashkenas
2011-07-22 08:01:09 -07:00

View File

@@ -806,6 +806,8 @@
if (this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
window.location.replace(this.options.root + '#' + this.fragment);
// Return immediately as browser will do redirect to new url
return true;
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = loc.hash.replace(hashStrip, '');
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);