mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
25 lines
456 B
JavaScript
25 lines
456 B
JavaScript
define([], function () {
|
|
|
|
function loadImage(elem, url) {
|
|
|
|
if (elem.tagName !== "IMG") {
|
|
|
|
var tmp = new Image();
|
|
|
|
tmp.onload = function () {
|
|
elem.style.backgroundImage = "url('" + url + "')";
|
|
};
|
|
tmp.src = url;
|
|
|
|
} else {
|
|
elem.setAttribute("src", url);
|
|
}
|
|
|
|
return Promise.resolve(elem);
|
|
}
|
|
|
|
return {
|
|
loadImage: loadImage
|
|
};
|
|
|
|
}); |