mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix notifications query
This commit is contained in:
parent
bdefc042ed
commit
18966acf72
9 changed files with 85 additions and 79 deletions
|
@ -71,18 +71,24 @@ define([], function () {
|
|||
}
|
||||
|
||||
var windowSize;
|
||||
function resetWindowSize() {
|
||||
windowSize = {
|
||||
innerHeight: window.innerHeight,
|
||||
innerWidth: window.innerWidth
|
||||
};
|
||||
var windowSizeEventsBound;
|
||||
function clearWindowSize() {
|
||||
console.log('clearWindowSize');
|
||||
windowSize = null;
|
||||
}
|
||||
|
||||
function getWindowSize() {
|
||||
if (!windowSize) {
|
||||
resetWindowSize();
|
||||
addEventListenerWithOptions(window, "orientationchange", resetWindowSize, { passive: true });
|
||||
addEventListenerWithOptions(window, 'resize', resetWindowSize, { passive: true });
|
||||
windowSize = {
|
||||
innerHeight: window.innerHeight,
|
||||
innerWidth: window.innerWidth
|
||||
};
|
||||
|
||||
if (!windowSizeEventsBound) {
|
||||
windowSizeEventsBound = true;
|
||||
addEventListenerWithOptions(window, "orientationchange", clearWindowSize, { passive: true });
|
||||
addEventListenerWithOptions(window, 'resize', clearWindowSize, { passive: true });
|
||||
}
|
||||
}
|
||||
|
||||
return windowSize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue