2022-07-29 20:00:36 +01:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', e =>
|
|
|
|
{
|
2022-09-16 16:49:58 +01:00
|
|
|
// check if the user is logged in, if not redirect to log in
|
|
|
|
/* fetch('/api/user/isLoggedIn').then(res =>
|
2022-07-29 20:00:36 +01:00
|
|
|
{
|
|
|
|
if (!res.ok)
|
|
|
|
{
|
|
|
|
window.location.href = './';
|
|
|
|
}
|
2022-09-16 16:49:58 +01:00
|
|
|
});*/
|
|
|
|
})
|
|
|
|
|
|
|
|
document.querySelector("#navOpen").addEventListener("click", e =>
|
|
|
|
{
|
|
|
|
document.querySelector("nav.sideNav").style.removeProperty("width");
|
|
|
|
document.querySelector("main.editor").style.removeProperty("margin-left");
|
|
|
|
e.target.style.removeProperty("visibility");
|
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector("#navClose").addEventListener("click", e =>
|
|
|
|
{
|
|
|
|
document.querySelector("nav.sideNav").style.width = "0";
|
|
|
|
document.querySelector("main.editor").style.marginLeft = "0";
|
|
|
|
document.querySelector("#navOpen").style.visibility = "visible";
|
|
|
|
});
|