mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update detail images
This commit is contained in:
parent
95a647e0df
commit
a0b6f768b3
14 changed files with 112 additions and 73 deletions
27
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
27
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
|
@ -97,12 +97,11 @@
|
|||
|
||||
var threshold = getThreshold();
|
||||
|
||||
function isVisible() {
|
||||
return visibleInViewport(this, true, false, 'both', threshold);
|
||||
function isVisible(elem) {
|
||||
return visibleInViewport(elem, true, false, 'both', threshold);
|
||||
}
|
||||
|
||||
function fillImage() {
|
||||
var elem = this;
|
||||
function fillImage(elem) {
|
||||
var source = elem.getAttribute('data-src');
|
||||
if (source) {
|
||||
ImageStore.setImageInto(elem, source);
|
||||
|
@ -116,19 +115,25 @@
|
|||
return;
|
||||
}
|
||||
|
||||
var images = $(elems),
|
||||
loaded;
|
||||
var images = elems;
|
||||
|
||||
unveilId++;
|
||||
var eventNamespace = 'unveil' + unveilId;
|
||||
|
||||
images.one("unveil", fillImage);
|
||||
|
||||
function unveil() {
|
||||
var inview = images.filter(isVisible);
|
||||
|
||||
loaded = inview.trigger("unveil");
|
||||
images = images.not(loaded);
|
||||
var remaining = [];
|
||||
|
||||
for (var i = 0, length = images.length; i < length; i++) {
|
||||
var img = images[i];
|
||||
if (isVisible(img)) {
|
||||
fillImage(img);
|
||||
} else {
|
||||
remaining.push(img);
|
||||
}
|
||||
}
|
||||
|
||||
images = remaining;
|
||||
|
||||
if (!images.length) {
|
||||
Events.off(window, 'scroll.' + eventNamespace);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue