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