aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/src/UserStatus.vue4
-rw-r--r--apps/user_status/src/components/SetStatusModal.vue20
2 files changed, 23 insertions, 1 deletions
diff --git a/apps/user_status/src/UserStatus.vue b/apps/user_status/src/UserStatus.vue
index d632d58a33c..704629f859f 100644
--- a/apps/user_status/src/UserStatus.vue
+++ b/apps/user_status/src/UserStatus.vue
@@ -43,7 +43,9 @@
</NcButton>
<!-- Status management modal -->
- <SetStatusModal v-if="isModalOpen" @close="closeModal" />
+ <SetStatusModal v-if="isModalOpen"
+ :inline="inline"
+ @close="closeModal" />
</component>
</template>
diff --git a/apps/user_status/src/components/SetStatusModal.vue b/apps/user_status/src/components/SetStatusModal.vue
index d763c094895..4047db23843 100644
--- a/apps/user_status/src/components/SetStatusModal.vue
+++ b/apps/user_status/src/components/SetStatusModal.vue
@@ -22,6 +22,7 @@
<template>
<NcModal size="normal"
:name="$t('user_status', 'Set status')"
+ :set-return-focus="setReturnFocus"
@close="closeModal">
<div class="set-status-modal">
<!-- Status selector -->
@@ -108,6 +109,18 @@ export default {
},
mixins: [OnlineStatusMixin],
+ props: {
+ /**
+ * Whether the component should be rendered as a Dashboard Status or a User Menu Entries
+ * true = Dashboard Status
+ * false = User Menu Entries
+ */
+ inline: {
+ type: Boolean,
+ default: false,
+ },
+ },
+
data() {
return {
clearAt: null,
@@ -156,6 +169,13 @@ export default {
return this.$t('user_status', 'Reset status')
},
+
+ setReturnFocus() {
+ if (this.inline) {
+ return undefined
+ }
+ return document.querySelector('[aria-controls="header-menu-user-menu"]') ?? undefined
+ },
},
watch: {