From d326e8f7889a852626e74aedcfe988a33f029a3e Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 1 Mar 2020 12:20:32 -0800 Subject: [PATCH] webapps.wiki: simplify and fix resize issue on mobile. --- extra/webapps/wiki/wiki-contents.css | 2 ++ extra/webapps/wiki/wiki-contents.js | 16 ---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/extra/webapps/wiki/wiki-contents.css b/extra/webapps/wiki/wiki-contents.css index f483883af2..86b15e24b6 100644 --- a/extra/webapps/wiki/wiki-contents.css +++ b/extra/webapps/wiki/wiki-contents.css @@ -20,6 +20,8 @@ @media screen and (max-width: 600px) { #left { + position: absolute; + margin-top: 40px; display: none; } diff --git a/extra/webapps/wiki/wiki-contents.js b/extra/webapps/wiki/wiki-contents.js index f2301587d0..25fd366a20 100644 --- a/extra/webapps/wiki/wiki-contents.js +++ b/extra/webapps/wiki/wiki-contents.js @@ -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() { var l = document.getElementById("left"); var m = document.getElementById("menu"); if (l.style.display === "") { - l.style.position = "absolute"; l.style.display = "inline"; - l.style.marginTop = "40px"; m.style.backgroundColor = "#f3f2ea"; } else { - l.style.position = ""; l.style.display = ""; - l.style.marginTop = ""; m.style.backgroundColor = ""; } }