jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/images/basicimagefetcher.js

20 lines
380 B
JavaScript
Raw Normal View History

2016-01-16 11:29:08 -07:00
define([], function () {
function loadImage(elem, url) {
if (elem.tagName !== "IMG") {
2016-04-23 20:04:04 -07:00
elem.style.backgroundImage = "url('" + url + "')";
return Promise.resolve(elem);
2016-01-16 11:29:08 -07:00
} else {
elem.setAttribute("src", url);
2016-03-04 20:39:49 -07:00
return Promise.resolve(elem);
2016-01-16 11:29:08 -07:00
}
}
return {
loadImage: loadImage
};
});