1
0
Fork 0
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:
Luke Pulverenti 2016-08-25 12:55:57 -04:00
parent bdefc042ed
commit 18966acf72
9 changed files with 85 additions and 79 deletions

View file

@ -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;