summaryrefslogtreecommitdiff
path: root/src/client/widgets/notifications.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/widgets/notifications.vue')
-rw-r--r--src/client/widgets/notifications.vue37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/client/widgets/notifications.vue b/src/client/widgets/notifications.vue
index 9d6282735b..490c4d758f 100644
--- a/src/client/widgets/notifications.vue
+++ b/src/client/widgets/notifications.vue
@@ -1,21 +1,23 @@
<template>
-<mk-container :style="`height: ${props.height}px;`" :show-header="props.showHeader" :scrollable="true">
- <template #header><fa :icon="faBell"/>{{ $t('notifications') }}</template>
- <template #func><button @click="configure()" class="_button"><fa :icon="faCog"/></button></template>
+<MkContainer :style="`height: ${props.height}px;`" :show-header="props.showHeader" :scrollable="true">
+ <template #header><Fa :icon="faBell"/>{{ $t('notifications') }}</template>
+ <template #func><button @click="configure()" class="_button"><Fa :icon="faCog"/></button></template>
<div>
- <x-notifications :include-types="props.includingTypes"/>
+ <XNotifications :include-types="props.includingTypes"/>
</div>
-</mk-container>
+</MkContainer>
</template>
<script lang="ts">
+import { defineComponent } from 'vue';
import { faBell, faCog } from '@fortawesome/free-solid-svg-icons';
-import MkContainer from '../components/ui/container.vue';
-import XNotifications from '../components/notifications.vue';
+import MkContainer from '@/components/ui/container.vue';
+import XNotifications from '@/components/notifications.vue';
import define from './define';
+import * as os from '@/os';
-export default define({
+const widget = define({
name: 'notifications',
props: () => ({
showHeader: {
@@ -32,7 +34,11 @@ export default define({
default: null,
},
})
-}).extend({
+});
+
+export default defineComponent({
+ extends: widget,
+
components: {
MkContainer,
XNotifications,
@@ -46,12 +52,15 @@ export default define({
methods: {
async configure() {
- this.$root.new(await import('../components/notification-setting-window.vue').then(m => m.default), {
+ os.popup(await import('@/components/notification-setting-window.vue'), {
includingTypes: this.props.includingTypes,
- }).$on('ok', async ({ includingTypes }) => {
- this.props.includingTypes = includingTypes;
- this.save();
- });
+ }, {
+ done: async (res) => {
+ const { includingTypes } = res;
+ this.props.includingTypes = includingTypes;
+ this.save();
+ }
+ }, 'closed');
}
}
});