This commit is contained in:
parent
fb6c9780f6
commit
bc73c88562
1 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ window.addEventListener("load", () => {
|
|||
/* Theme */
|
||||
const dark = "dark";
|
||||
const light = "light";
|
||||
const attribute = ["disabled", "disabled"];
|
||||
const attribute = "disabled";
|
||||
const updateTheme = (theme) => {
|
||||
{
|
||||
const elementToEnable = document.getElementById(
|
||||
|
@ -31,10 +31,10 @@ window.addEventListener("load", () => {
|
|||
`hljs-${theme.matches ? light : dark}-theme`
|
||||
);
|
||||
|
||||
if (elementToEnable.hasAttribute(attribute[0])) {
|
||||
elementToEnable.removeAttribute(attribute[0]);
|
||||
if (elementToEnable.hasAttribute(attribute)) {
|
||||
elementToEnable.removeAttribute(attribute);
|
||||
}
|
||||
elementToDisable.setAttribute(...attribute);
|
||||
elementToDisable.setAttribute(attribute, attribute);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue