From 3a3764bf68901f71766c5320d23cacec737ea622 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 13 Jan 2025 21:15:22 -0800 Subject: [PATCH] refac: drag region --- src/lib/components/layout/Sidebar.svelte | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 887cbcc6c..a55d36b94 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -360,12 +360,17 @@ localStorage.sidebar = value; // nav element is not available on the first render - const navElement = document.getElementsByTagName('nav')[0]; - if (!value) { - navElement.style['-webkit-app-region'] = 'drag'; + if ($mobile) { + const navElement = document.getElementsByTagName('nav')[0]; + + if (!value) { + navElement.style['-webkit-app-region'] = 'drag'; + } else { + navElement.style['-webkit-app-region'] = 'no-drag'; + } } else { - navElement.style['-webkit-app-region'] = 'no-drag'; + navElement.style['-webkit-app-region'] = 'drag'; } });