From 4adb279c7aa702b72b4a3a9840e55af4dfb045db Mon Sep 17 00:00:00 2001 From: James Yu Date: Mon, 14 Oct 2024 17:08:41 +0800 Subject: [PATCH] Hide toolbar on viewer launch --- dev/editviewer.py | 1 + viewer/components/gui.ts | 13 +++++++------ viewer/viewer.html | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dev/editviewer.py b/dev/editviewer.py index f9d469027..1e521518a 100644 --- a/dev/editviewer.py +++ b/dev/editviewer.py @@ -14,6 +14,7 @@ .replace('''''', '''\n ''') .replace('''''', '''''') .replace('''''', '''''') + .replace('''
''', '''
''') .replace('''
''', '''''') ) diff --git a/viewer/components/gui.ts b/viewer/components/gui.ts index c43cf143b..5b982a2b7 100644 --- a/viewer/components/gui.ts +++ b/viewer/components/gui.ts @@ -31,11 +31,15 @@ export async function patchViewerUI() { const params = await utils.getParams() if (params.toolbar === 0) { - const containerDom = document.getElementById('viewerContainer')! - containerDom.style.top = '32px' + document.getElementsByClassName('toolbar')[0]?.classList.remove('hide') + document.getElementById('viewerContainer')!.style.top = '32px' } - document.getElementById('outerContainer')!.onmouseleave = () => { hideToolbar(params) } + document.getElementById('outerContainer')!.onmouseleave = () => { + if (params.toolbar !== 0) { + hideToolbar(params) + } + } document.getElementById('outerContainer')!.onmousemove = (e) => { if (params.toolbar === 0) { @@ -54,9 +58,6 @@ export async function patchViewerUI() { document.getElementById('sidebarResizer')?.classList.add('hidden') document.getElementById('firstPage')?.previousElementSibling?.classList.add('visibleLargeView') - if (params.toolbar !== 0) { - document.getElementsByClassName('toolbar')[0]?.classList.add('hide') - } const template = document.createElement('template') template.innerHTML = diff --git a/viewer/viewer.html b/viewer/viewer.html index 48b286276..10e634932 100644 --- a/viewer/viewer.html +++ b/viewer/viewer.html @@ -84,7 +84,7 @@
-
+