41 lines
982 B
JavaScript
41 lines
982 B
JavaScript
var coll = document.getElementsByClassName("collapsible");
|
|
var i;
|
|
|
|
for (i = 0; i < coll.length; i++) {
|
|
coll[i].addEventListener("click", function () {
|
|
this.classList.toggle("active");
|
|
var content = this.nextElementSibling;
|
|
if (content.style.maxHeight) {
|
|
content.style.maxHeight = null;
|
|
} else {
|
|
content.style.maxHeight = content.scrollHeight + "px";
|
|
}
|
|
});
|
|
}
|
|
|
|
function logout() {
|
|
localStorage.removeItem('token');
|
|
location.reload();
|
|
}
|
|
|
|
function logoutVisibility() {
|
|
if (localStorage.getItem("token") !== null) {
|
|
document.getElementById("logout").style.display = "";
|
|
}
|
|
else {
|
|
document.getElementById("logout").style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function loginVisibility() {
|
|
if (localStorage.getItem("token") !== null) {
|
|
document.getElementById("login").style.display = "none";
|
|
}
|
|
else {
|
|
document.getElementById("login").style.display = "";
|
|
|
|
}
|
|
} |