summaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2021-05-26 18:21:30 +0200
committerLouis Chemineau <louis@chmn.me>2021-06-07 16:48:55 +0200
commit8a66cdbdf382b179b8d81ef46bc283f7d2a0edb0 (patch)
treea2bd6909a89325c5a10730ddc270c4b31600b9d6 /apps/files/src
parentae4907b6c95b7ac5d36ef358048c7acafd517c07 (diff)
downloadnextcloud-server-8a66cdbdf382b179b8d81ef46bc283f7d2a0edb0.tar.gz
nextcloud-server-8a66cdbdf382b179b8d81ef46bc283f7d2a0edb0.zip
Emit sidebar events
Signed-off-by: Louis Chemineau <louis@chmn.me> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com> Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/views/Sidebar.vue23
1 files changed, 22 insertions, 1 deletions
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index d3938156172..da25a3e6ce1 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -29,7 +29,11 @@
@close="close"
@update:active="setActiveTab"
@update:starred="toggleStarred"
- @[defaultActionListener].stop.prevent="onDefaultAction">
+ @[defaultActionListener].stop.prevent="onDefaultAction"
+ @opening="handleOpening"
+ @opened="handleOpened"
+ @closing="handleClosing"
+ @closed="handleClosed">
<!-- TODO: create a standard to allow multiple elements here? -->
<template v-if="fileInfo" #description>
<LegacyView v-for="view in views"
@@ -78,6 +82,7 @@
import { encodePath } from '@nextcloud/paths'
import $ from 'jquery'
import axios from '@nextcloud/axios'
+import { emit } from '@nextcloud/event-bus'
import AppSidebar from '@nextcloud/vue/dist/Components/AppSidebar'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
@@ -422,6 +427,22 @@ export default {
this.Sidebar.file = ''
this.resetData()
},
+
+ /**
+ * Emit SideBar events.
+ */
+ handleOpening() {
+ emit('files:sidebar:opening')
+ },
+ handleOpened() {
+ emit('files:sidebar:opened')
+ },
+ handleClosing() {
+ emit('files:sidebar:closing')
+ },
+ handleClosed() {
+ emit('files:sidebar:closed')
+ },
},
}
</script>