jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/images/basicimagefetcher.js
2016-04-23 23:04:04 -04:00

20 lines
380 B
JavaScript

define([], function () {
function loadImage(elem, url) {
if (elem.tagName !== "IMG") {
elem.style.backgroundImage = "url('" + url + "')";
return Promise.resolve(elem);
} else {
elem.setAttribute("src", url);
return Promise.resolve(elem);
}
}
return {
loadImage: loadImage
};
});