1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-04-22 12:09:08 -04:00
parent e1d75fd9c2
commit aaeb444675
22 changed files with 253 additions and 90 deletions

View file

@ -147,8 +147,8 @@ milliseconds.
this.listen(window, 'popstate', '_urlChanged');
this.listen(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
this._urlChanged();
this._initialized = true;
this._urlChanged();
},
detached: function() {
this.unlisten(window, 'hashchange', '_hashChanged');
@ -209,14 +209,17 @@ milliseconds.
// nothing to do, the URL didn't change
return;
}
// Need to use a full URL in case the containing page has a base URI.
var fullNewUrl = new URL(
newUrl, window.location.protocol + '//' + window.location.host).href;
var now = this._now();
var shouldReplace =
this._lastChangedAt + this.dwellTime > now;
this._lastChangedAt = now;
if (shouldReplace) {
window.history.replaceState({}, '', newUrl);
window.history.replaceState({}, '', fullNewUrl);
} else {
window.history.pushState({}, '', newUrl);
window.history.pushState({}, '', fullNewUrl);
}
this.fire('location-changed', {}, {node: window});
},
@ -231,7 +234,6 @@ milliseconds.
if (!href) {
return;
}
window.history.pushState({}, '', href);
this.fire('location-changed', {}, {node: window});
event.preventDefault();
@ -304,8 +306,10 @@ milliseconds.
!this._urlSpaceRegExp.test(normalizedHref)) {
return null;
}
return normalizedHref;
// Need to use a full URL in case the containing page has a base URI.
var fullNormalizedHref = new URL(
normalizedHref, window.location.href).href;
return fullNormalizedHref;
},
_makeRegExp: function(urlSpaceRegex) {
return RegExp(urlSpaceRegex);