mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-30 17:53:31 -04:00 
			
		
		
		
	fix: Don't open the sidebar drawer by default on medium screens (#6107)
This commit is contained in:
		| @@ -173,7 +173,7 @@ export default defineNuxtComponent({ | |||||||
|  |  | ||||||
|     const sidebar = ref<boolean>(false); |     const sidebar = ref<boolean>(false); | ||||||
|     onMounted(() => { |     onMounted(() => { | ||||||
|       sidebar.value = display.mdAndUp.value; |       sidebar.value = display.lgAndUp.value; | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     function cookbookAsLink(cookbook: ReadCookBook): SideBarLink { |     function cookbookAsLink(cookbook: ReadCookBook): SideBarLink { | ||||||
|   | |||||||
| @@ -105,7 +105,6 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
| import { useWindowSize } from "@vueuse/core"; |  | ||||||
| import { useLoggedInState } from "~/composables/use-logged-in-state"; | import { useLoggedInState } from "~/composables/use-logged-in-state"; | ||||||
| import type { SidebarLinks } from "~/types/application-types"; | import type { SidebarLinks } from "~/types/application-types"; | ||||||
| import UserAvatar from "~/components/Domain/User/UserAvatar.vue"; | import UserAvatar from "~/components/Domain/User/UserAvatar.vue"; | ||||||
| @@ -160,20 +159,6 @@ export default defineNuxtComponent({ | |||||||
|       get: () => props.modelValue, |       get: () => props.modelValue, | ||||||
|       set: value => context.emit("update:modelValue", value), |       set: value => context.emit("update:modelValue", value), | ||||||
|     }); |     }); | ||||||
|     watch(showDrawer, () => { |  | ||||||
|       if (window.innerWidth < 760 && state.hasOpenedBefore === false) { |  | ||||||
|         state.hasOpenedBefore = true; |  | ||||||
|       } |  | ||||||
|     }); |  | ||||||
|     const { width: wWidth } = useWindowSize(); |  | ||||||
|     watch(wWidth, (w) => { |  | ||||||
|       if (w > 760) { |  | ||||||
|         showDrawer.value = true; |  | ||||||
|       } |  | ||||||
|       else { |  | ||||||
|         showDrawer.value = false; |  | ||||||
|       } |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     const allLinks = computed(() => [...props.topLink, ...(props.secondaryLinks || [])]); |     const allLinks = computed(() => [...props.topLink, ...(props.secondaryLinks || [])]); | ||||||
|     function initDropdowns() { |     function initDropdowns() { | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ const { $globals } = useNuxtApp(); | |||||||
|  |  | ||||||
| const sidebar = ref<boolean>(false); | const sidebar = ref<boolean>(false); | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|   sidebar.value = !display.md.value; |   sidebar.value = display.lgAndUp.value; | ||||||
| }); | }); | ||||||
|  |  | ||||||
| const topLinks: SidebarLinks = [ | const topLinks: SidebarLinks = [ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user