feat: refs #8004 hide rightFilter
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-10-14 08:49:01 +02:00
parent b32c8dd9f0
commit df775ea594
5 changed files with 9 additions and 7 deletions

View File

@ -2,9 +2,10 @@
import { ref, onMounted, useSlots } from 'vue'; import { ref, onMounted, useSlots } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import isMobile from 'src/composables/isMobile'; import { useQuasar } from 'quasar';
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const stateStore = useStateStore(); const stateStore = useStateStore();
const slots = useSlots(); const slots = useSlots();
const hasContent = ref(false); const hasContent = ref(false);
@ -23,7 +24,7 @@ onMounted(() => {
childList: true, childList: true,
attributes: true, attributes: true,
}); });
if ((!slots['right-panel'] && !hasContent.value) || isMobile) if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
stateStore.rightDrawer = false; stateStore.rightDrawer = false;
}); });
</script> </script>

View File

@ -52,7 +52,7 @@ onBeforeMount(async () => {
}); });
onMounted(() => { onMounted(() => {
stateStore.rightMenu = false; stateStore.rightDrawerChangeValue(false);
console.log('useStateStore: ', useStateStore.rightMenu); console.log('useStateStore: ', useStateStore.rightMenu);
}); });
async function fetch() { async function fetch() {

View File

@ -1,3 +0,0 @@
const regex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
const isMobile = regex.test(navigator.userAgent);
export default isMobile;

View File

@ -2,7 +2,6 @@
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue'; import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import isMobile from 'src/composables/isMobile';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import FetchedTags from 'components/ui/FetchedTags.vue';

View File

@ -15,6 +15,10 @@ export const useStateStore = defineStore('stateStore', () => {
rightDrawer.value = !rightDrawer.value; rightDrawer.value = !rightDrawer.value;
} }
function rightDrawerChangeValue(value) {
rightDrawer.value = value;
}
function toggleSubToolbar() { function toggleSubToolbar() {
subToolbar.value = !subToolbar.value; subToolbar.value = !subToolbar.value;
} }
@ -50,5 +54,6 @@ export const useStateStore = defineStore('stateStore', () => {
isRightDrawerShown, isRightDrawerShown,
isSubToolbarShown, isSubToolbarShown,
toggleSubToolbar, toggleSubToolbar,
rightDrawerChangeValue,
}; };
}); });