mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 08:46:09 +01:00
This commit is contained in:
parent
02f6509206
commit
d40a3ac58b
1 changed files with 10 additions and 8 deletions
|
|
@ -102,16 +102,18 @@ export const loadAssets = (data: Config.IAppearance) => {
|
|||
// 不能使用 data.iconVer,因为其他主题也需要加载默认图标,此时 data.iconVer 为其他图标的版本号
|
||||
const iconURL = `/appearance/icons/${["ant", "material"].includes(data.icon) ? data.icon : "material"}/icon.js?v=${Constants.SIYUAN_VERSION}`;
|
||||
if (iconDefaultScriptElement) {
|
||||
iconDefaultScriptElement.remove();
|
||||
let svgElement = document.body.firstElementChild;
|
||||
while (svgElement.tagName === "svg") {
|
||||
const currentSvgElement = svgElement;
|
||||
svgElement = svgElement.nextElementSibling;
|
||||
if (!currentSvgElement.getAttribute("data-name")) {
|
||||
currentSvgElement.remove();
|
||||
if (!iconDefaultScriptElement.getAttribute("src").startsWith(iconURL)) {
|
||||
iconDefaultScriptElement.remove();
|
||||
let svgElement = document.body.firstElementChild;
|
||||
while (svgElement.tagName === "svg") {
|
||||
const currentSvgElement = svgElement;
|
||||
svgElement = svgElement.nextElementSibling;
|
||||
if (!currentSvgElement.getAttribute("data-name")) {
|
||||
currentSvgElement.remove();
|
||||
}
|
||||
}
|
||||
loadThirdIcon(iconURL, data);
|
||||
}
|
||||
loadThirdIcon(iconURL, data);
|
||||
} else {
|
||||
loadThirdIcon(iconURL, data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue