2
0
Fork 0

fix: issue with button title

This commit is contained in:
Hugo 2023-08-05 15:41:41 +02:00
parent b0f84486d8
commit 1e87f2be84
8 changed files with 9 additions and 8 deletions

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -14,7 +14,7 @@
<body>
<header>
<a id="logo" href="/index.html">Decentrala</a>
<button id="theme-switcher"></button>
<button id="theme-switcher" title="turn light off"></button>
<a class="account" href="/pages/account.html">Nalog</a>
</header>
<main>

View File

@ -22,7 +22,8 @@ if (theme !== null) {
}
theme_switcher.addEventListener("click", () => {
if (theme_switcher.getAttribute("title").indexOf("off") !== -1) {
const attribute = theme_switcher.getAttribute("title") ?? "off"
if (attribute.indexOf("off") !== -1) {
changeToDarkTheme();
} else {
changeToLightTheme();