', e.style.right = "0", document.addEventListener("click", closeSidebarOnClickOutside)) : (document.getElementById("menuicon").innerHTML = '
', e.style.right = "-250px", document.removeEventListener("click", closeSidebarOnClickOutside)) } function closeSidebarOnClickOutside(e) { document.getElementById("sidebar").contains(e.target) || "menuicon" === e.target.id || toggleSidebar() }