From fcd657c10ea14290455cfb0bf2de89375a664143 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Wed, 13 Jan 2021 21:37:29 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix=20sidebar=20mobile-md=20scal?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #31 --- src/components/Dashboard.svelte | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard.svelte b/src/components/Dashboard.svelte index 0e2b5cc0..35abd556 100644 --- a/src/components/Dashboard.svelte +++ b/src/components/Dashboard.svelte @@ -24,19 +24,40 @@ ) check = true; })(navigator.userAgent || navigator.vendor || window.opera); + const aspectratio=window.innerWidth/window.innerHeight; + if(aspectratio<=0.765){ + check=true; + } return check; } $: mobile = ismobile(); + window.addEventListener('resize', function(){ + const aspectratio=window.innerWidth/window.innerHeight; + if(aspectratio<=0.765){ + navOpen=false; + mobile=true; + }else{ + navOpen=true; + mobile=false; + + } + }); +// $: if (mobile===true) { +// console.log("changed to mobile"); +// } +// $: if (mobile===false) { +// console.log("changed to md"); +// } function logout() { localForage.clear(); location.replace("/"); } -
+