mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Beautified all js in web dashboard
This commit is contained in:
parent
5895f209e7
commit
6bfd795635
346 changed files with 72978 additions and 375 deletions
|
@ -1 +1,18 @@
|
|||
define(["dom"],function(dom){"use strict";function loadImage(elem,url){return elem?"IMG"!==elem.tagName?(elem.style.backgroundImage="url('"+url+"')",Promise.resolve()):loadImageIntoImg(elem,url):Promise.reject("elem cannot be null")}function loadImageIntoImg(elem,url){return new Promise(function(resolve,reject){dom.addEventListener(elem,"load",resolve,{once:!0}),elem.setAttribute("src",url)})}return{loadImage:loadImage}});
|
||||
define(["dom"], function(dom) {
|
||||
"use strict";
|
||||
|
||||
function loadImage(elem, url) {
|
||||
return elem ? "IMG" !== elem.tagName ? (elem.style.backgroundImage = "url('" + url + "')", Promise.resolve()) : loadImageIntoImg(elem, url) : Promise.reject("elem cannot be null")
|
||||
}
|
||||
|
||||
function loadImageIntoImg(elem, url) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
dom.addEventListener(elem, "load", resolve, {
|
||||
once: !0
|
||||
}), elem.setAttribute("src", url)
|
||||
})
|
||||
}
|
||||
return {
|
||||
loadImage: loadImage
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue