From 678ef296b4462a88c725bee4e30b6556e971739d Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 17 May 2020 16:44:58 +0200 Subject: [PATCH] fully hide the navbar when asked --- copyparty/web/md.css | 11 ----------- copyparty/web/md.js | 34 ++-------------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/copyparty/web/md.css b/copyparty/web/md.css index 3875acf4..e32b45c3 100644 --- a/copyparty/web/md.css +++ b/copyparty/web/md.css @@ -243,12 +243,6 @@ blink { z-index: 10; width: calc(100% - 1em); } - #mn.undocked { - position: fixed; - padding: 1.7em 0 1.5em 1em; - box-shadow: 0 0 .5em rgba(0, 0, 0, 0.3); - background: #f7f7f7; - } #mn a { color: #444; background: none; @@ -440,11 +434,6 @@ blink { html.dark #toc::-webkit-scrollbar-thumb { background: #b80; } - html.dark #mn.undocked { - box-shadow: 0 0 .5em #555; - border: none; - background: #0a0a0a; - } } @media screen and (min-width: 85.5em) { #toc { width: 30em } diff --git a/copyparty/web/md.js b/copyparty/web/md.js index 5cede57a..21e05f72 100644 --- a/copyparty/web/md.js +++ b/copyparty/web/md.js @@ -395,40 +395,10 @@ var redraw = (function () { dom_navtgl.onclick = function () { - var timeout = null; - function show_nav(e) { - if (e && e.target == dom_hbar && e.pageX && e.pageX < dom_hbar.offsetWidth / 2) - return; - - clearTimeout(timeout); - dom_nav.style.display = 'block'; - } - function hide_nav() { - clearTimeout(timeout); - timeout = setTimeout(function () { - dom_nav.style.display = 'none'; - }, 30); - } var hidden = dom_navtgl.innerHTML == 'hide nav'; dom_navtgl.innerHTML = hidden ? 'show nav' : 'hide nav'; - if (hidden) { - dom_nav.setAttribute('class', 'undocked'); - dom_nav.style.display = 'none'; - dom_nav.style.top = dom_hbar.offsetHeight + 'px'; - dom_nav.onmouseenter = show_nav; - dom_nav.onmouseleave = hide_nav; - dom_hbar.onmouseenter = show_nav; - dom_hbar.onmouseleave = hide_nav; - } - else { - dom_nav.setAttribute('class', ''); - dom_nav.style.display = 'block'; - dom_nav.style.top = '0'; - dom_nav.onmouseenter = null; - dom_nav.onmouseleave = null; - dom_hbar.onmouseenter = null; - dom_hbar.onmouseleave = null; - } + dom_nav.style.display = hidden ? 'none' : 'block'; + if (window.localStorage) localStorage.setItem('hidenav', hidden ? 1 : 0);