ThemeSettings: fixed bug of buttons not appearing
This commit is contained in:
parent
26c8767bfd
commit
8c709f5213
|
@ -7,7 +7,7 @@ class ThemeSettings {
|
||||||
|
|
||||||
getDescription () {return "Allows you to change Theme Variables within BetterDiscord. Adds a Settings button (similar to Plugins) to customizable Themes in your Themes Page.";}
|
getDescription () {return "Allows you to change Theme Variables within BetterDiscord. Adds a Settings button (similar to Plugins) to customizable Themes in your Themes Page.";}
|
||||||
|
|
||||||
getVersion () {return "1.0.4";}
|
getVersion () {return "1.0.5";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -45,9 +45,14 @@ class ThemeSettings {
|
||||||
(change, j) => {
|
(change, j) => {
|
||||||
if (change.addedNodes) {
|
if (change.addedNodes) {
|
||||||
change.addedNodes.forEach((node) => {
|
change.addedNodes.forEach((node) => {
|
||||||
if (node.tagName && node.querySelector(".ui-switch") && this.isThemesPage()) {
|
if (this.isThemesPage() && node.tagName) {
|
||||||
|
if (node.classList && node.classList.contains(BDFDB.disCN.scrollerwrap)) {
|
||||||
|
for (let li of node.querySelectorAll(".bda-slist > li")) this.addSettingsButton(li);
|
||||||
|
}
|
||||||
|
else if (node.tagName == "LI" && node.querySelector(".ui-switch")) {
|
||||||
this.addSettingsButton(node);
|
this.addSettingsButton(node);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +68,7 @@ class ThemeSettings {
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
if (node.tagName && node.getAttribute("layer-id") == "user-settings") {
|
if (node.tagName && node.getAttribute("layer-id") == "user-settings") {
|
||||||
BDFDB.addObserver(this, node, {name:"innerSettingsWindowObserver"}, {childList:true,subtree:true});
|
BDFDB.addObserver(this, node, {name:"innerSettingsWindowObserver"}, {childList:true,subtree:true});
|
||||||
if (this.isThemesPage(node))for (let li of node.querySelectorAll(".bda-slist > li")) this.addSettingsButton(li);
|
if (this.isThemesPage(node)) for (let li of node.querySelectorAll(".bda-slist > li")) this.addSettingsButton(li);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue