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