mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
lazy load scripts
This commit is contained in:
parent
1f0760df09
commit
89e0515a15
31 changed files with 366 additions and 328 deletions
|
@ -153,7 +153,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#musicAlbumsPage", function () {
|
||||
$(document).on('pageinitdepends', "#musicAlbumsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -248,7 +248,7 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', "#musicAlbumsPage", function () {
|
||||
}).on('pageshown', "#musicAlbumsPage", function () {
|
||||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
|
@ -274,27 +274,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
}).on('pageshow', "#musicAlbumsPage", function () {
|
||||
|
||||
updateFilterControls(this);
|
||||
|
||||
var updateScheduled = false;
|
||||
function onscreen() {
|
||||
var viewportBottom = $(window).scrollTop() + $(window).height();
|
||||
return ($(document).height() - viewportBottom) < 100;
|
||||
}
|
||||
$(window).on('scroll', function () {
|
||||
console.log('load');
|
||||
if (!updateScheduled) {
|
||||
setTimeout(function () {
|
||||
if (onscreen()) {
|
||||
console.log('load');
|
||||
}
|
||||
updateScheduled = false;
|
||||
}, 500);
|
||||
updateScheduled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
Loading…
Add table
Add a link
Reference in a new issue