1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-26 04:28:28 +09:00
misskey/src/client/app/desktop/views/widgets/messaging.vue

56 lines
1.2 KiB
Vue
Raw Normal View History

2018-02-15 12:36:42 +09:00
<template>
<div class="mkw-messaging">
2018-04-20 07:45:37 +09:00
<mk-widget-container :show-header="props.design == 0">
<template slot="header"><fa icon="comments"/>{{ $t('title') }}</template>
<button slot="func" @click="add"><fa icon="plus"/></button>
2018-04-20 07:45:37 +09:00
<x-messaging ref="index" compact @navigate="navigate"/>
2018-04-20 07:45:37 +09:00
</mk-widget-container>
2018-02-15 12:36:42 +09:00
</div>
</template>
<script lang="ts">
2018-02-25 00:18:09 +09:00
import define from '../../../common/define-widget';
import i18n from '../../../i18n';
2018-02-25 00:18:09 +09:00
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
2018-04-20 12:18:50 +09:00
import MkMessagingWindow from '../components/messaging-window.vue';
2018-02-22 01:08:49 +09:00
2018-02-15 12:36:42 +09:00
export default define({
name: 'messaging',
2018-02-21 15:30:03 +09:00
props: () => ({
2018-02-15 12:36:42 +09:00
design: 0
2018-02-21 15:30:03 +09:00
})
2018-02-15 12:36:42 +09:00
}).extend({
i18n: i18n('desktop/views/widgets/messaging.vue'),
components: {
XMessaging: () => import('../../../common/views/components/messaging.vue').then(m => m.default)
},
2018-02-15 12:36:42 +09:00
methods: {
navigate(user) {
2018-11-09 08:13:34 +09:00
this.$root.new(MkMessagingRoomWindow, {
2018-02-22 23:53:07 +09:00
user: user
});
2018-02-15 12:36:42 +09:00
},
2018-04-20 12:18:50 +09:00
add() {
2018-11-09 08:13:34 +09:00
this.$root.new(MkMessagingWindow);
2018-04-20 12:18:50 +09:00
},
2018-02-15 12:36:42 +09:00
func() {
if (this.props.design == 1) {
this.props.design = 0;
} else {
this.props.design++;
}
2018-04-29 17:17:15 +09:00
this.save();
2018-02-15 12:36:42 +09:00
}
}
});
</script>
<style lang="stylus" scoped>
.mkw-messaging
2018-04-20 08:05:57 +09:00
.mk-messaging
2018-02-15 12:36:42 +09:00
max-height 250px
overflow auto
</style>