mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update lazy loading
This commit is contained in:
parent
bcb026427e
commit
67bc4c227e
5 changed files with 52 additions and 39 deletions
32
dashboard-ui/components/ironcardlist/ironcardlist.js
Normal file
32
dashboard-ui/components/ironcardlist/ironcardlist.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
define(['iron-list', 'lazyload-image'], function () {
|
||||
|
||||
function getTemplate(scrollTarget) {
|
||||
|
||||
var maxPhysical = 80;
|
||||
|
||||
// is="lazyload-image"
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'components/ironcardlist/ironcardlist.template.html', true);
|
||||
|
||||
xhr.onload = function (e) {
|
||||
|
||||
var html = this.response;
|
||||
|
||||
html = html.replace('${maxphysical}', maxPhysical);
|
||||
html = html.replace('${scrolltarget}', scrollTarget);
|
||||
|
||||
resolve(html);
|
||||
}
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
getTemplate: getTemplate
|
||||
};
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue