Sharkey/src/client/app/desktop/views/widgets/messaging.vue

53 lines
1.1 KiB
Vue
Raw Normal View History

2018-02-15 05:36:42 +02:00
<template>
<div class="mkw-messaging">
2018-04-20 01:45:37 +03: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 01:45:37 +03:00
<mk-messaging ref="index" compact @navigate="navigate"/>
</mk-widget-container>
2018-02-15 05:36:42 +02:00
</div>
</template>
<script lang="ts">
2018-02-24 17:18:09 +02:00
import define from '../../../common/define-widget';
import i18n from '../../../i18n';
2018-02-24 17:18:09 +02:00
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
2018-04-20 06:18:50 +03:00
import MkMessagingWindow from '../components/messaging-window.vue';
2018-02-21 18:08:49 +02:00
2018-02-15 05:36:42 +02:00
export default define({
name: 'messaging',
2018-02-21 08:30:03 +02:00
props: () => ({
2018-02-15 05:36:42 +02:00
design: 0
2018-02-21 08:30:03 +02:00
})
2018-02-15 05:36:42 +02:00
}).extend({
i18n: i18n('desktop/views/widgets/messaging.vue'),
2018-02-15 05:36:42 +02:00
methods: {
navigate(user) {
2018-02-22 16:53:07 +02:00
(this as any).os.new(MkMessagingRoomWindow, {
user: user
});
2018-02-15 05:36:42 +02:00
},
2018-04-20 06:18:50 +03:00
add() {
(this as any).os.new(MkMessagingWindow);
},
2018-02-15 05:36:42 +02:00
func() {
if (this.props.design == 1) {
this.props.design = 0;
} else {
this.props.design++;
}
2018-04-29 11:17:15 +03:00
this.save();
2018-02-15 05:36:42 +02:00
}
}
});
</script>
<style lang="stylus" scoped>
.mkw-messaging
2018-04-20 02:05:57 +03:00
.mk-messaging
2018-02-15 05:36:42 +02:00
max-height 250px
overflow auto
</style>