#6891 add toggle #417

Merged
jorgep merged 9 commits from 6891-addToggleFilterPanel into dev 2024-06-06 08:48:28 +00:00
1 changed files with 6 additions and 7 deletions
Showing only changes of commit f55e9d7c32 - Show all commits
src/components/common

View File

@ -9,19 +9,18 @@ const rightPanel = ref(null);
onMounted(() => {
rightPanel.value = document.querySelector('#right-panel');
if (rightPanel.value.childNodes.length) hasContent.value = true;
if (!rightPanel.value) return;
// Check if there's content to display
const observer = new MutationObserver(() => {
hasContent.value = rightPanel.value.childNodes.length;
});
if (rightPanel.value)
observer.observe(rightPanel.value, {
subtree: true,
childList: true,
attributes: true,
});
observer.observe(rightPanel.value, {
subtree: true,
childList: true,
attributes: true,
});
if (!slots['right-panel'] && !hasContent.value) stateStore.rightDrawer = false;
});