mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
This commit is contained in:
parent
436135492b
commit
b3bd02c5a1
1 changed files with 14 additions and 6 deletions
|
|
@ -98,23 +98,31 @@ export const loadAssets = (data: Config.IAppearance) => {
|
|||
(!isBuiltInIcon && iconScriptElement && iconScriptElement.getAttribute("src").startsWith(iconThirdURL))) {
|
||||
return;
|
||||
}
|
||||
Array.from(document.body.children).forEach(item => {
|
||||
if (item.tagName === "svg" && !item.getAttribute("data-name") && item.id !== "iconsMaterial") {
|
||||
item.remove();
|
||||
}
|
||||
});
|
||||
if (iconDefaultScriptElement && !iconDefaultScriptElement.getAttribute("src").startsWith(iconDefaultURL)) {
|
||||
iconDefaultScriptElement.remove();
|
||||
if (data.icon === "ant") {
|
||||
document.querySelectorAll("#iconsMaterial").forEach(item => {
|
||||
item.remove();
|
||||
});
|
||||
} else {
|
||||
document.querySelectorAll("#iconsAnt").forEach(item => {
|
||||
item.remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
addScript(iconDefaultURL, "iconDefaultScript").then(() => {
|
||||
if (!isBuiltInIcon) {
|
||||
iconScriptElement?.remove();
|
||||
addScript(iconThirdURL, "iconScript");
|
||||
addScript(iconThirdURL, "iconScript").then(() => {
|
||||
Array.from(document.body.children).forEach((item, index) => {
|
||||
if (item.tagName === "svg" &&
|
||||
index !== 0 &&
|
||||
!item.getAttribute("data-name") &&
|
||||
!["iconsMaterial", "iconsAnt"].includes(item.id)) {
|
||||
item.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue