[Pkg-javascript-commits] [backbone] 17/281: Fix root prefix handling in navigate.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit b20f54f24550ace1998e41184fa503bba856533b
Author: kpdecker <kpdecker at gmail.com>
Date:   Thu Sep 8 00:25:08 2011 -0500

    Fix root prefix handling in navigate.
    
    Fixes prefix removal when the root prefix is included as part of the navigate route parameter.
---
 backbone.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/backbone.js b/backbone.js
index 31f5541..a8fbea2 100644
--- a/backbone.js
+++ b/backbone.js
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list