From d3f25fa29045b8a6ba9332284d07549185c62c70 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 22 Jun 2022 20:47:53 +0900 Subject: [PATCH] tweak client --- packages/client/src/components/global/page-header.vue | 10 ++++++++-- packages/client/src/components/ui/window.vue | 3 ++- packages/client/src/pages/admin/_header_.vue | 8 +++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/global/page-header.vue b/packages/client/src/components/global/page-header.vue index 0ad7699834..a750fdb309 100644 --- a/packages/client/src/components/global/page-header.vue +++ b/packages/client/src/components/global/page-header.vue @@ -114,7 +114,11 @@ function onTabMousedown(tab: Tab, ev: MouseEvent): void { } function onTabClick(tab: Tab, ev: MouseEvent): void { - if (tab.onClick) tab.onClick(ev); + if (tab.onClick) { + ev.preventDefault(); + ev.stopPropagation(); + tab.onClick(ev); + } if (tab.key) { emit('update:tab', tab.key); } @@ -150,7 +154,7 @@ onMounted(() => { if (el && el.parentElement) { narrow = el.parentElement.offsetWidth < 500; ro = new ResizeObserver((entries, observer) => { - if (el.parentElement) { + if (el.parentElement && document.body.contains(el)) { narrow = el.parentElement.offsetWidth < 500; } }); @@ -268,6 +272,8 @@ onUnmounted(() => { > .icon { margin-right: 8px; + width: 16px; + text-align: center; } > .title { diff --git a/packages/client/src/components/ui/window.vue b/packages/client/src/components/ui/window.vue index 3cd4378f03..a5efab154b 100644 --- a/packages/client/src/components/ui/window.vue +++ b/packages/client/src/components/ui/window.vue @@ -402,7 +402,7 @@ export default defineComponent({ height: 100%; > .header { - --height: 50px; + --height: 45px; &.mini { --height: 38px; @@ -415,6 +415,7 @@ export default defineComponent({ user-select: none; height: var(--height); border-bottom: solid 1px var(--divider); + font-size: 95%; > .left, > .right { > .button { diff --git a/packages/client/src/pages/admin/_header_.vue b/packages/client/src/pages/admin/_header_.vue index 59c5ce4f47..1883b4abee 100644 --- a/packages/client/src/pages/admin/_header_.vue +++ b/packages/client/src/pages/admin/_header_.vue @@ -105,7 +105,11 @@ function onTabMousedown(tab: Tab, ev: MouseEvent): void { } function onTabClick(tab: Tab, ev: MouseEvent): void { - if (tab.onClick) tab.onClick(ev); + if (tab.onClick) { + ev.preventDefault(); + ev.stopPropagation(); + tab.onClick(ev); + } if (tab.key) { emit('update:tab', tab.key); } @@ -217,6 +221,8 @@ onUnmounted(() => { > .icon { margin-right: 8px; + width: 16px; + text-align: center; } > .title {