update components
This commit is contained in:
parent
7dbb1f7535
commit
b447272b19
26 changed files with 478 additions and 107 deletions
|
@ -4,18 +4,21 @@ define([], function () {
|
|||
|
||||
if (elem.tagName !== "IMG") {
|
||||
|
||||
var tmp = new Image();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
tmp.onload = function () {
|
||||
elem.style.backgroundImage = "url('" + url + "')";
|
||||
};
|
||||
tmp.src = url;
|
||||
var tmp = new Image();
|
||||
|
||||
tmp.onload = function () {
|
||||
elem.style.backgroundImage = "url('" + url + "')";
|
||||
resolve(elem);
|
||||
};
|
||||
tmp.src = url;
|
||||
});
|
||||
|
||||
} else {
|
||||
elem.setAttribute("src", url);
|
||||
return Promise.resolve(elem);
|
||||
}
|
||||
|
||||
return Promise.resolve(elem);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue