From b32a34c52fe42cabb09837a6033829a5b84d5266 Mon Sep 17 00:00:00 2001 From: Raimonds Simanovskis Date: Fri, 22 Jul 2011 17:55:09 +0300 Subject: [PATCH] do not call loadUrl when redirecting to hash based URL on non-push state browser --- backbone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backbone.js b/backbone.js index 14431e71..c793c652 100644 --- a/backbone.js +++ b/backbone.js @@ -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);