Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2022-11-03 20:19:23 +0300
committerMarcel Klehr <mklehr@gmx.net>2022-11-03 20:19:40 +0300
commit7a23f3b0d2ac512055da954ecb038560564f7a80 (patch)
tree0d8aa26e0ab9ae14d0c47c69add005e64bcd7088
parent8fc4238bd974b6b12972ce37ff9455feac175592 (diff)
Fix click-outside for sidebar
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r--src/App.vue7
-rw-r--r--src/components/Sidebar.vue8
2 files changed, 8 insertions, 7 deletions
diff --git a/src/App.vue b/src/App.vue
index 862dc9d3..ec1d06d8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -23,7 +23,7 @@
<template>
<NcContent app-name="deck" :class="{ 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }">
<AppNavigation />
- <NcAppContent @click="clickCloseSidebar()">
+ <NcAppContent>
<router-view />
</NcAppContent>
@@ -122,11 +122,6 @@ export default {
hideModal() {
this.$router.push({ name: 'board' })
},
- clickCloseSidebar() {
- if (this.sidebarShown) {
- this.$router.push({ name: 'board' })
- }
- },
},
}
</script>
diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue
index ca8c7719..0d7b5d59 100644
--- a/src/components/Sidebar.vue
+++ b/src/components/Sidebar.vue
@@ -21,7 +21,7 @@
-->
<template>
- <router-view v-if="visible" name="sidebar" />
+ <router-view v-if="visible" v-click-outside="onClickOutside" name="sidebar" />
</template>
<script>
@@ -37,6 +37,12 @@ export default {
closeSidebar() {
this.$router.push({ name: 'board' })
},
+ onClickOutside(e) {
+ if (Array.from(document.querySelectorAll('.card')).some(node => node.contains(e.target))) {
+ return
+ }
+ this.closeSidebar()
+ },
},
}
</script>