From 012b40141412b3264233b894f3a6a5d38bee9e69 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 24 Jan 2025 11:07:39 +0100 Subject: [PATCH] feat: refs #8304 remove st-default --- src/components/ui/VnSubToolbar.vue | 32 ++++++--------- src/pages/Worker/Card/WorkerCalendar.vue | 52 ++++++++++++++++-------- 2 files changed, 48 insertions(+), 36 deletions(-) diff --git a/src/components/ui/VnSubToolbar.vue b/src/components/ui/VnSubToolbar.vue index d61ca87e5..6555e729a 100644 --- a/src/components/ui/VnSubToolbar.vue +++ b/src/components/ui/VnSubToolbar.vue @@ -4,7 +4,6 @@ import { useStateStore } from 'stores/useStateStore'; import { computed } from 'vue'; const stateStore = useStateStore(); -const general = ref(null); const actions = ref(null); const data = ref(null); const opts = { subtree: true, childList: true, attributes: true }; @@ -14,24 +13,22 @@ onMounted(() => { stateStore.toggleSubToolbar(); actions.value = document.querySelector('#st-actions'); data.value = document.querySelector('#st-data'); - general.value = document.querySelector('#st-default'); - if (!actions.value && !data.value && !general.value) return; + if (!actions.value && !data.value) return; // Check if there's content to display const observer = new MutationObserver( () => (hasContent.value = - actions.value?.childNodes?.length + data.value?.childNodes?.length + general.value?.childNodes?.length) + actions.value?.childNodes?.length + data.value?.childNodes?.length), ); if (actions.value) observer.observe(actions.value, opts); if (data.value) observer.observe(data.value, opts); - if (general.value) observer.observe(general.value, opts); }); -const generalChildCount = () => { - return !!general.value.childNodes.length; -} +const actionsChildCount = () => { + return !!actions.value.childNodes.length; +}; onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar); @@ -39,19 +36,16 @@ onBeforeUnmount(() => stateStore.toggleSubToolbar() && hasSubToolbar); - en: addAbsencesText: To start adding absences, click an absence type from the right menu and then on the day you want to add an absence