Skip to content

Commit

Permalink
Merge pull request jashkenas#497 from rsim/return_immediately_after_r…
Browse files Browse the repository at this point in the history
…edirect_to_hash_route

return immediately after redirect to hash route
  • Loading branch information
jashkenas committed Jul 22, 2011
2 parents a6a478f + b32a34c commit 63a4be9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backbone.js
Expand Up @@ -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);
Expand Down

0 comments on commit 63a4be9

Please sign in to comment.