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

use shared image loader

This commit is contained in:
Luke Pulverenti 2016-01-16 13:29:08 -05:00
parent a08a1c37ec
commit ad1f82dbaf
17 changed files with 570 additions and 347 deletions

View file

@ -0,0 +1,25 @@
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
};
});