mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-03 21:56:18 +02:00
enhance(frontend): 設定検索時に対象が含まれるMkFolderを自動で開いておくように
This commit is contained in:
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<template>
|
||||
<div ref="root" :class="[$style.root, { [$style.highlighted]: highlighted }]">
|
||||
<slot></slot>
|
||||
<slot :isParentOfTarget="isParentOfTarget"></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,9 +39,10 @@ const rootElMutationObserver = new MutationObserver(() => {
|
||||
const injectedSearchMarkerId = inject(DI.inAppSearchMarkerId, null);
|
||||
const searchMarkerId = computed(() => injectedSearchMarkerId?.value ?? window.location.hash.slice(1));
|
||||
const highlighted = ref(props.markerId === searchMarkerId.value);
|
||||
const isParentOfTarget = computed(() => props.children?.includes(searchMarkerId.value));
|
||||
|
||||
function checkChildren() {
|
||||
if (props.children?.includes(searchMarkerId.value)) {
|
||||
if (isParentOfTarget.value) {
|
||||
const el = window.document.querySelector(`[data-in-app-search-marker-id="${searchMarkerId.value}"]`);
|
||||
highlighted.value = el == null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user