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-07-08 14:10:20 -04:00
parent e6183509f8
commit c01a55384e
26 changed files with 296 additions and 115 deletions

View file

@ -109,6 +109,14 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
target.addEventListener(type, handler, optionsOrCapture);
}
function removeEventListenerWithOptions(target, type, handler, options) {
var optionsOrCapture = options;
if (!supportsCaptureOption) {
optionsOrCapture = options.capture;
}
target.removeEventListener(type, handler, optionsOrCapture);
}
function unveilWithIntersection(images, root) {
var filledCount = 0;
@ -177,10 +185,22 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
}
if (!images.length) {
document.removeEventListener('focus', unveil, true);
document.removeEventListener('scroll', unveil, true);
document.removeEventListener(wheelEvent, unveil, true);
window.removeEventListener('resize', unveil, true);
removeEventListenerWithOptions(document, 'focus', unveil, {
capture: true,
passive: true
});
removeEventListenerWithOptions(document, 'scroll', unveil, {
capture: true,
passive: true
});
removeEventListenerWithOptions(document, wheelEvent, unveil, {
capture: true,
passive: true
});
removeEventListenerWithOptions(window, 'resize', unveil, {
capture: true,
passive: true
});
}
}
@ -196,11 +216,14 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
}, 1);
}
addEventListenerWithOptions(document, 'focus', unveil, {
capture: true,
passive: true
});
addEventListenerWithOptions(document, 'scroll', unveil, {
capture: true,
passive: true
});
document.addEventListener('focus', unveil, true);
addEventListenerWithOptions(document, wheelEvent, unveil, {
capture: true,
passive: true