webapps.wiki: simplify and fix resize issue on mobile.

master
John Benediktsson 2020-03-01 12:20:32 -08:00
parent 9336cd6efc
commit d326e8f788
2 changed files with 2 additions and 16 deletions

View File

@ -20,6 +20,8 @@
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#left { #left {
position: absolute;
margin-top: 40px;
display: none; display: none;
} }

View File

@ -1,27 +1,11 @@
function resetSidebar() {
var l = document.getElementById("left");
var m = document.getElementById("menu");
l.style.position = "";
l.style.display = "";
l.style.marginTop = "";
m.style.backgroundColor = "";
}
window.addEventListener("resize", resetSidebar);
function toggleSidebar() { function toggleSidebar() {
var l = document.getElementById("left"); var l = document.getElementById("left");
var m = document.getElementById("menu"); var m = document.getElementById("menu");
if (l.style.display === "") { if (l.style.display === "") {
l.style.position = "absolute";
l.style.display = "inline"; l.style.display = "inline";
l.style.marginTop = "40px";
m.style.backgroundColor = "#f3f2ea"; m.style.backgroundColor = "#f3f2ea";
} else { } else {
l.style.position = "";
l.style.display = ""; l.style.display = "";
l.style.marginTop = "";
m.style.backgroundColor = ""; m.style.backgroundColor = "";
} }
} }