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

update dialogs

This commit is contained in:
Luke Pulverenti 2016-05-28 14:03:38 -04:00
parent b385aa2d95
commit 797ab3899b
23 changed files with 469 additions and 95 deletions

View file

@ -4,6 +4,29 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
var thresholdY;
var windowSize;
var supportsIntersectionObserver = function () {
if (window.IntersectionObserver) {
// The api exists in chrome 50 but doesn't work
if (browser.chrome) {
var version = parseInt(browser.version.split('.')[0]);
return version >= 51;
}
return true;
}
return false;
}();
function resetWindowSize() {
windowSize = {
innerHeight: window.innerHeight,
innerWidth: window.innerWidth
};
}
function resetThresholds() {
var x = screen.availWidth;
@ -19,24 +42,18 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
resetWindowSize();
}
window.addEventListener("orientationchange", resetThresholds);
window.addEventListener('resize', resetThresholds);
events.on(layoutManager, 'modechange', resetThresholds);
var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel');
function resetWindowSize() {
windowSize = {
innerHeight: window.innerHeight,
innerWidth: window.innerWidth
};
if (!supportsIntersectionObserver) {
window.addEventListener("orientationchange", resetThresholds);
window.addEventListener('resize', resetThresholds);
events.on(layoutManager, 'modechange', resetThresholds);
resetThresholds();
}
resetThresholds();
function isVisible(elem) {
return visibleinviewport(elem, true, thresholdX, thresholdY, windowSize);
}
var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel');
var self = {};
function fillImage(elem, source, enableEffects) {
@ -92,6 +109,12 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
var filledCount = 0;
var options = {};
if (!layoutManager.desktop) {
options.rootMargin = "125%";
}
var observer = new IntersectionObserver(function (entries) {
for (var j = 0, length2 = entries.length; j < length2; j++) {
var entry = entries[j];
@ -109,9 +132,7 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
//observer.disconnect();
}
},
{
/* Using default options. Details below */
}
options
);
// Start observing an element
for (var i = 0, length = images.length; i < length; i++) {
@ -119,22 +140,6 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
}
}
var supportsIntersectionObserver = function () {
if (window.IntersectionObserver) {
// The api exists in chrome 50 but doesn't work
if (browser.chrome) {
var version = parseInt(browser.version.split('.')[0]);
return version >= 51;
}
return true;
}
return false;
}();
function unveilElements(images) {
if (!images.length) {