Commit 25fb981d3e

25fb981d3e20474387d50234ee54c355b0777ea1

parent: 457e895080

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-26 13:01 UTC

Update AnnouncementsPanel.vue

Layout: unified · split

docs/.vitepress/theme/components/AnnouncementsPanel.vue +27 −14
@@ -38,10 +38,27 @@ const scrollRef = ref<HTMLElement>()
3838const showFade = ref(true)
3939const panelStyle = ref<Record<string, string>>({})
4040
41onClickOutside(wrapperRef, () => {
42 // keep panel open while the filter menu is up
43 if (!filterOpen.value) isOpen.value = false
44})
41/* Type filter (gear menu) */
42const typeFilter = ref('')
43const filterOpen = ref(false)
44const filterBtnRef = ref<HTMLElement>()
45const filterMenuRef = ref<HTMLElement>()
46const filterStyle = ref<Record<string, string>>({})
47
48/* Detail popup */
49const activePost = ref<Announcement | null>(null)
50const backdropRef = ref<HTMLElement>()
51
52onClickOutside(
53 wrapperRef,
54 () => {
55 // keep panel open while the filter menu or detail popup is up
56 if (!filterOpen.value && !activePost.value) isOpen.value = false
57 },
58 {
59 ignore: [filterMenuRef, backdropRef]
60 }
61)
4562
4663function onScroll() {
4764 if (!scrollRef.value) return
@@ -91,14 +108,6 @@ useEventListener(inBrowser ? window : undefined, 'resize', () => {
91108 if (filterOpen.value) updateFilterPosition()
92109})
93110
94/* Type filter (gear menu) */
95// '' = all types
96const typeFilter = ref('')
97const filterOpen = ref(false)
98const filterBtnRef = ref<HTMLElement>()
99const filterMenuRef = ref<HTMLElement>()
100const filterStyle = ref<Record<string, string>>({})
101
102111function updateFilterPosition() {
103112 const btn = filterBtnRef.value
104113 if (!btn) return
@@ -132,7 +141,6 @@ const filtered = computed(() =>
132141)
133142
134143/* Detail popup */
135const activePost = ref<Announcement | null>(null)
136144
137145function openPost(post: Announcement) {
138146 markRead(post.id)
@@ -274,7 +282,7 @@ onUnmounted(() => {
274282 <!-- detail popup -->
275283 <Teleport to="body">
276284 <Transition name="ann-detail-fade">
277 <div v-if="activePost" class="ann-backdrop" @click.self="closePost">
285 <div v-if="activePost" ref="backdropRef" class="ann-backdrop" @click.self="closePost">
278286 <Transition name="ann-detail-slide" appear>
279287 <div v-if="activePost" class="ann-detail" role="dialog" aria-modal="true" :aria-label="activePost.title">
280288 <div class="ann-detail-head">
@@ -770,8 +778,13 @@ html.effects-disabled .ann-detail-close:active {
770778 transform: translateY(8px);
771779 }
772780
781 .ann-filter-menu {
782 z-index: 10000;
783 }
784
773785 .ann-backdrop {
774786 align-items: stretch;
787 z-index: 10001;
775788 }
776789
777790 .ann-detail {