diff --git a/packages/admin/app.vue b/packages/admin/app.vue index 28d8964..5bcc0a3 100644 --- a/packages/admin/app.vue +++ b/packages/admin/app.vue @@ -21,7 +21,7 @@ bg-blue hover:bg-blue-a focus:outline outline-2 outline-offset-3 outline-blue-a rounded-xl transition duration-300 active:scale-95" :class="{ 'bg-blue-a': route.path === '/' }" - @click="viewShowFullNavigationBar = false" + @click="viewToggleFullNavigationBar(false)" > @@ -38,7 +38,7 @@ '!px-0 !max-w-[3.5rem]': !viewShowFullNavigationBar, 'bg-blue-a': route.path === '/playlist' }" - @click="viewShowFullNavigationBar = false" + @click="viewToggleFullNavigationBar(false)" > @@ -111,15 +111,15 @@ class="aspect-square flex flex-row justify-center items-center h-14 bg-blue hover:bg-blue-a focus:outline outline-2 outline-offset-3 outline-blue-a rounded-xl transition duration-300 active:scale-95" - @click="viewShowFullNavigationBar = !viewShowFullNavigationBar" + @click="viewToggleFullNavigationBar()" > @@ -127,7 +127,7 @@
(false) const viewShowFullNavigationBar = ref(false) -const viewShowFullNavigationBarToggles = ref(0) const viewShowFullNavigationBarRealState = ref(false) +const viewFullNavigationBarToggles = ref(0) const viewShowPageContent = ref(true) -watch(viewShowFullNavigationBar, (value) => { - viewShowFullNavigationBarToggles.value++ +function viewToggleFullNavigationBar (show?: boolean) { + if (show === undefined) { + viewShowFullNavigationBar.value = !viewShowFullNavigationBar.value + viewFullNavigationBarToggles.value++ + } else + if (viewShowFullNavigationBar.value !== show) { + viewShowFullNavigationBar.value = show + viewFullNavigationBarToggles.value++ + } setTimeout(() => { - viewShowFullNavigationBarRealState.value = value + viewShowFullNavigationBarRealState.value = viewShowFullNavigationBar.value }, 300) - if (value) { - viewShowPageContent.value = !value + if (viewShowFullNavigationBar.value) { + viewShowPageContent.value = !viewShowFullNavigationBar.value } else { - setTimeout(() => { viewShowPageContent.value = !value }, 150) + setTimeout(() => { viewShowPageContent.value = !viewShowFullNavigationBar.value }, 150) } -}) +}