Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09b992b

Browse files
committed
[CHG]修复异步创建第二个实例失败问题
[CHG]优化loading默认样式
1 parent 93ca755 commit 09b992b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ezuikit.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const addJs = (filepath, callback, isReadyFun) => {
3232
oJs.setAttribute("src", filepath);
3333
oJs.onload = callback;
3434
document.getElementsByTagName("head")[0].appendChild(oJs);
35+
} else {
36+
callback();
3537
}
3638
};
3739
const addCss = (filepath, callback) => {
@@ -397,7 +399,7 @@ class Status {
397399
loadingContainerDOM.appendChild(loadingItemContainer);
398400
}
399401
loadingSetText(opt) {
400-
this.loadingClear();
402+
this.loadingClearText();
401403
if (document.getElementById(`${this.id}-loading-item-0`)) {
402404
var textElement = document.getElementById(`${this.id}-loading-item-0`).childNodes[1];
403405
if(!textElement) {
@@ -407,9 +409,13 @@ class Status {
407409
loadingItemContainer.appendChild(textElement);
408410
}
409411
textElement.innerHTML = opt.text;
410-
if (opt.color) {
411-
textElement.style.color = opt.color;
412-
}
412+
textElement.style.color = opt.color || "#FFFFFF";
413+
}
414+
}
415+
loadingClearText() {
416+
var elements = document.getElementById(`${this.id}-loading-item-0`).childNodes;
417+
if(elements.length > 1) {
418+
elements[1].parentNode.removeChild(elements[1]);
413419
}
414420
}
415421
loadingClear() {

0 commit comments

Comments
 (0)