2020-06-23 13:32:42 +00:00
|
|
|
// document.addEventListener("DOMContentLoaded", function(){
|
|
|
|
// // Handler when the DOM is fully loaded
|
|
|
|
// var path = window.location.pathname;
|
|
|
|
//
|
|
|
|
// if(path === "/menuplans" || path === "/vagttelefon" || path === "/")
|
|
|
|
// {
|
|
|
|
// document.getElementById ('toggle').addEventListener ('click', toggleMenu, false);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// function toggleMenu() {
|
|
|
|
// var buttonElement = document.getElementById('menuIcon');
|
|
|
|
//
|
|
|
|
// var htmlElement = document.getElementsByTagName('html')[0];
|
|
|
|
// var logoElement = document.getElementById('sdeLogo');
|
|
|
|
// var mainElement = document.getElementsByTagName('main')[0];
|
|
|
|
//
|
|
|
|
// var menu = document.getElementById('menu');
|
|
|
|
//
|
|
|
|
// if(buttonElement.alt === '-')
|
|
|
|
// {
|
|
|
|
// htmlElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
|
|
|
// logoElement.src = '/images/logos/Logo-hvid.svg';
|
|
|
|
// menu.classList.remove('d-none');
|
|
|
|
// mainElement.classList.add('d-none');
|
|
|
|
//
|
|
|
|
// buttonElement.alt = 'X';
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// htmlElement.style.backgroundColor = 'rgb(255, 255, 255)';
|
|
|
|
// logoElement.src = '/images/logos/Logo-normal.svg';
|
|
|
|
// menu.classList.add('d-none');
|
|
|
|
// mainElement.classList.remove('d-none');
|
|
|
|
//
|
|
|
|
// buttonElement.alt = '-';
|
|
|
|
// }
|
|
|
|
// }
|
2020-06-15 13:09:13 +00:00
|
|
|
|
2020-06-23 13:32:42 +00:00
|
|
|
function toggleMenu(menu) {
|
|
|
|
let menuElement = document.getElementById(menu);
|
2020-06-11 12:52:15 +00:00
|
|
|
|
2020-06-23 13:32:42 +00:00
|
|
|
if(menuElement.classList.contains("hide"))
|
|
|
|
menuElement.classList.remove("hide");
|
2020-06-11 12:52:15 +00:00
|
|
|
else
|
2020-06-23 13:32:42 +00:00
|
|
|
menuElement.classList.add("hide");
|
2020-06-11 12:52:15 +00:00
|
|
|
}
|