mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-23 22:08:04 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user