Messing with voters

This commit is contained in:
2024-10-30 17:44:47 +01:00
parent b991ae8d00
commit b7381eafa3
8 changed files with 104 additions and 30 deletions

View File

@@ -47,17 +47,21 @@ if (! location.pathname.includes('login')) {
const userMenu = document.querySelector('.dropdown-trigger');
const userCaret = document.querySelector('#user-caret');
document.querySelector('#for-vocabs').addEventListener('click', function () {
vocabs.classList.toggle('is-hidden');
const forVocabs = document.querySelector('#for-vocabs')
if (forVocabs) {
forVocabs.addEventListener('click', function () {
vocabs.classList.toggle('is-hidden');
if (this.firstElementChild.classList.contains('fa-angle-right')) {
this.firstElementChild.classList.remove('fa-angle-right');
this.firstElementChild.classList.add('fa-angle-down');
} else {
this.firstElementChild.classList.remove('fa-angle-down');
this.firstElementChild.classList.add('fa-angle-right');
}
});
if (this.firstElementChild.classList.contains('fa-angle-right')) {
this.firstElementChild.classList.remove('fa-angle-right');
this.firstElementChild.classList.add('fa-angle-down');
} else {
this.firstElementChild.classList.remove('fa-angle-down');
this.firstElementChild.classList.add('fa-angle-right');
}
});
}
userMenu.addEventListener('click', function () {
document.querySelector('.dropdown').classList.toggle('is-active');