From b97ebe9e0b38bc55f2750d0d6ac20ac5cf886289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Viguier?= Date: Wed, 4 Dec 2024 17:46:59 +0100 Subject: [PATCH] Close left menu when loading the gallery (#2785) --- resources/js/views/gallery-panels/Albums.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/js/views/gallery-panels/Albums.vue b/resources/js/views/gallery-panels/Albums.vue index fec5a3928c3..570905fa564 100644 --- a/resources/js/views/gallery-panels/Albums.vue +++ b/resources/js/views/gallery-panels/Albums.vue @@ -235,9 +235,13 @@ onKeyStroke("k", () => !shouldIgnoreKeystroke() && user.value?.id === null && (i const { onPaste, dragEnd, dropUpload } = useMouseEvents(rootRights, is_upload_visible, list_upload_files); -window.addEventListener("paste", onPaste); -window.addEventListener("dragover", dragEnd); -window.addEventListener("drop", dropUpload); +onMounted(() => { + window.addEventListener("paste", onPaste); + window.addEventListener("dragover", dragEnd); + window.addEventListener("drop", dropUpload); + togglableStore.left_menu_open = false; +}); + router.afterEach(() => { window.removeEventListener("paste", onPaste); window.removeEventListener("dragover", dragEnd);