diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-08-04 11:58:14 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-08-05 17:03:36 +0200 |
commit | 3be3c34e39f5066ea0161fa2ca5ede1fa0211f39 (patch) | |
tree | 5d352ab81751c7d6f25fedb1c76ebd842521da75 /apps/user_status/src | |
parent | ae6be0c110dcf150440e9d7af70162b8510736c7 (diff) | |
download | nextcloud-server-3be3c34e39f5066ea0161fa2ca5ede1fa0211f39.tar.gz nextcloud-server-3be3c34e39f5066ea0161fa2ca5ede1fa0211f39.zip |
Status integration
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/user_status/src')
-rw-r--r-- | apps/user_status/src/App.vue | 40 | ||||
-rw-r--r-- | apps/user_status/src/main-user-status-menu.js | 16 |
2 files changed, 54 insertions, 2 deletions
diff --git a/apps/user_status/src/App.vue b/apps/user_status/src/App.vue index 116c7a0ca47..c9e95fa87fd 100644 --- a/apps/user_status/src/App.vue +++ b/apps/user_status/src/App.vue @@ -20,9 +20,10 @@ --> <template> - <li> + <li :class="{ inline }"> <div id="user-status-menu-item"> <span + v-if="!inline" id="user-status-menu-item__header" :title="displayName"> {{ displayName }} @@ -71,6 +72,12 @@ export default { ActionButton, SetStatusModal, }, + props: { + inline: { + type: Boolean, + default: false, + }, + }, data() { return { isModalOpen: false, @@ -237,7 +244,7 @@ export default { </script> <style lang="scss"> -#user-status-menu-item { +li:not(.inline) #user-status-menu-item { &__header { display: block; color: var(--color-main-text); @@ -270,4 +277,33 @@ export default { } } } + +.inline #user-status-menu-item__subheader { + width: 100%; + + > button { + background-color: var(--color-main-background); + background-size: 16px; + border: 0; + border-radius: var(--border-radius-pill); + font-weight: normal; + font-size: 0.875em; + padding-left: 40px; + + &:hover, + &:focus { + background-color: var(--color-background-hover); + } + + &.icon-loading-small { + &::after { + left: 21px; + } + } + } +} + + li { + list-style-type: none; + } </style> diff --git a/apps/user_status/src/main-user-status-menu.js b/apps/user_status/src/main-user-status-menu.js index 795f41df4e7..c6d23337526 100644 --- a/apps/user_status/src/main-user-status-menu.js +++ b/apps/user_status/src/main-user-status-menu.js @@ -20,4 +20,20 @@ const app = new Vue({ store, }).$mount('li[data-id="user_status-menuitem"]') +document.addEventListener('DOMContentLoaded', function() { + if (!OCA.Dashboard) { + return + } + + OCA.Dashboard.registerStatus('status', (el) => { + const Dashboard = Vue.extend(App) + return new Dashboard({ + propsData: { + inline: true, + }, + store, + }).$mount(el) + }) +}) + export { app } |