Merge pull request #2272 from nextcloud/enh/clickOutsideToCloseSidebar
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<router-view v-if="visible" name="sidebar" />
|
<router-view v-if="visible" v-click-outside="onClickOutside" name="sidebar" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -37,6 +37,12 @@ export default {
|
|||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
this.$router.push({ name: 'board' })
|
this.$router.push({ name: 'board' })
|
||||||
},
|
},
|
||||||
|
onClickOutside(e) {
|
||||||
|
if (Array.from(document.querySelectorAll('.card')).some(node => node.contains(e.target))) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.closeSidebar()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user