|
@@ -154,6 +154,8 @@
|
|
|
* @api public
|
|
* @api public
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+ page.baseSearch = '';
|
|
|
|
|
+
|
|
|
page.start = function(options) {
|
|
page.start = function(options) {
|
|
|
options = options || {};
|
|
options = options || {};
|
|
|
if (running) return;
|
|
if (running) return;
|
|
@@ -166,7 +168,11 @@
|
|
|
}
|
|
}
|
|
|
if (true === options.hashbang) hashbang = true;
|
|
if (true === options.hashbang) hashbang = true;
|
|
|
if (!dispatch) return;
|
|
if (!dispatch) return;
|
|
|
- var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + location.search : location.pathname + location.search + location.hash;
|
|
|
|
|
|
|
+ var search = location.search.replace(page.baseSearch, '').replace('&&', '&').replace('?&', '?');
|
|
|
|
|
+ if (search === '?') {
|
|
|
|
|
+ search = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + search : location.pathname + search + location.hash;
|
|
|
page.replace(url, null, true, dispatch);
|
|
page.replace(url, null, true, dispatch);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -330,7 +336,11 @@
|
|
|
if (hashbang) {
|
|
if (hashbang) {
|
|
|
current = base + location.hash.replace('#!', '');
|
|
current = base + location.hash.replace('#!', '');
|
|
|
} else {
|
|
} else {
|
|
|
- current = location.pathname + location.search;
|
|
|
|
|
|
|
+ var search = location.search.replace(page.baseSearch, '').replace('&&', '&').replace('?&', '?');
|
|
|
|
|
+ if (search === '?') {
|
|
|
|
|
+ search = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ current = location.pathname + search;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (current === ctx.canonicalPath) return;
|
|
if (current === ctx.canonicalPath) return;
|