Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3abf47e2ea | ||
|
|
fb5052d43d |
No files matched your search
@@ -113,13 +113,14 @@ button:hover { background: var(--c-accent-hover); }
|
||||
.nav a:hover { color: var(--c-accent); }
|
||||
|
||||
.nav__dropdown { position: relative; cursor: default; }
|
||||
|
||||
.nav__dropdownMenu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
min-width: 12rem;
|
||||
margin-top: var(--space-2);
|
||||
margin-top: 0;
|
||||
list-style: none;
|
||||
background: var(--c-bg);
|
||||
border: 1px solid var(--c-border);
|
||||
@@ -132,3 +133,12 @@ button:hover { background: var(--c-accent-hover); }
|
||||
|
||||
.nav__list a { display: block; padding: var(--space-1) var(--space-2); }
|
||||
.nav__list a:hover { background: var(--c-surface); border-radius: var(--radius); }
|
||||
|
||||
|
||||
|
||||
@media (max-width: 640px) {
|
||||
button {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
font-size: .875rem;
|
||||
}
|
||||
}
|
||||
@@ -60,11 +60,25 @@ function init() {
|
||||
, errmsg: `liste konnte nicht aktualsiiert werden`
|
||||
|
||||
})
|
||||
|
||||
} else if (event.target.matches(".list__deleteButton")) {
|
||||
deleteList(event.target.closest("li"));
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector(".nav").addEventListener("click", (event) => {
|
||||
|
||||
if (event.target.matches(".nav__dropdown")) {
|
||||
event.target.closest("li").classList.add("is-open");
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.querySelector("body").addEventListener("click", (event) => {
|
||||
if (!event.target.matches(".nav__dropdown")) {
|
||||
document.querySelector(".is-open")?.classList.remove("is-open");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
@@ -151,6 +151,16 @@ function init() {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
document.querySelector(".nav").addEventListener("click", (event) => {
|
||||
|
||||
if (event.target.matches(".nav__dropdown")) {
|
||||
event.target.closest("li").classList.add("is-open");
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector(".displayedList").addEventListener("change", (e) => {
|
||||
@@ -161,6 +171,14 @@ function init() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
document.querySelector("body").addEventListener("click", (event) => {
|
||||
if (!event.target.matches(".nav__dropdown")) {
|
||||
document.querySelector(".is-open")?.classList.remove("is-open");
|
||||
}
|
||||
});
|
||||
|
||||
console.log("javascript initialized!");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user