make query strings work with pagejs
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
if (urlQueryString.has('lang')) {
|
||||
urlQueryString.delete('lang');
|
||||
var newUrl = [location.protocol, '//', location.host, location.pathname].join('') +
|
||||
urlQueryString.toString() +
|
||||
(urlQueryString.toString() !== '' ? '?' + urlQueryString.toString() : '') +
|
||||
window.location.hash;
|
||||
window.location = newUrl;
|
||||
return;
|
||||
|
9
node_modules/page/page.js
generated
vendored
9
node_modules/page/page.js
generated
vendored
@@ -1126,8 +1126,11 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
Context.prototype.save = function() {
|
||||
var page = this.page;
|
||||
if (hasHistory) {
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath);
|
||||
var pathWithoutQuerystring = this.path.replace('?' + this.querystring, '');
|
||||
pathWithoutQuerystring = pathWithoutQuerystring === '' ? '/' : pathWithoutQuerystring;
|
||||
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && pathWithoutQuerystring !== '/' || this.querystring !== '' ? page._window.location.pathname + '#!' + this.path : this.canonicalPath);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1189,7 +1192,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
m = this.regexp.exec(decodeURIComponent(pathname));
|
||||
|
||||
if (!m) return false;
|
||||
|
||||
|
||||
delete params[0]
|
||||
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
|
Reference in New Issue
Block a user