Removed fragment stripper. Changes to query params will trigger route change.

This commit is contained in:
Ryan Mohr
2013-11-21 13:36:28 -10:00
parent 6fb8e7af33
commit ddbdd0660c
2 changed files with 5 additions and 6 deletions

View File

@@ -1336,9 +1336,6 @@
// Cached regex for removing a trailing slash.
var trailingSlash = /\/$/;
// Cached regex for stripping urls of hash and query.
var pathStripper = /[?#].*$/;
// Has the history handling already been started?
History.started = false;
@@ -1488,9 +1485,6 @@
var url = this.root + (fragment = this.getFragment(fragment || ''));
// Strip the fragment of the query and hash for matching.
fragment = fragment.replace(pathStripper, '');
if (this.fragment === fragment) return;
this.fragment = fragment;

View File

@@ -211,6 +211,11 @@
equal(router.page, '20');
});
test("routes via navigate with params", 1, function() {
Backbone.history.navigate('query/test?a=b', {trigger: true});
equal(router.queryArgs, 'a=b');
});
test("routes via navigate for backwards-compatibility", 2, function() {
Backbone.history.navigate('search/manhattan/p20', true);
equal(router.query, 'manhattan');