mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
1ad3cfbf43
commit
106870b066
11 changed files with 99 additions and 65 deletions
|
@ -70,11 +70,30 @@ define([], function () {
|
|||
target.removeEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
var windowSize;
|
||||
function resetWindowSize() {
|
||||
windowSize = {
|
||||
innerHeight: window.innerHeight,
|
||||
innerWidth: window.innerWidth
|
||||
};
|
||||
}
|
||||
|
||||
function getWindowSize() {
|
||||
if (!windowSize) {
|
||||
resetWindowSize();
|
||||
addEventListenerWithOptions(window, "orientationchange", resetWindowSize, { passive: true });
|
||||
addEventListenerWithOptions(window, 'resize', resetWindowSize, { passive: true });
|
||||
}
|
||||
|
||||
return windowSize;
|
||||
}
|
||||
|
||||
return {
|
||||
parentWithAttribute: parentWithAttribute,
|
||||
parentWithClass: parentWithClass,
|
||||
parentWithTag: parentWithTag,
|
||||
addEventListener: addEventListenerWithOptions,
|
||||
removeEventListener: removeEventListenerWithOptions
|
||||
removeEventListener: removeEventListenerWithOptions,
|
||||
getWindowSize: getWindowSize
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue