2018-04-08 02:30:37 +09:00
|
|
|
<template>
|
2018-09-18 14:50:13 +09:00
|
|
|
<mk-window ref="window" is-modal @closed="onWindowClosed" :animation="animation">
|
2019-02-18 11:13:56 +09:00
|
|
|
<template #header :class="$style.header"><fa icon="retweet"/>{{ $t('title') }}</template>
|
2018-09-18 05:35:06 +09:00
|
|
|
<mk-renote-form ref="form" :note="note" @posted="onPosted" @canceled="onCanceled" v-hotkey.global="keymap"/>
|
2018-04-08 02:30:37 +09:00
|
|
|
</mk-window>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-09 03:44:35 +09:00
|
|
|
import i18n from '../../../i18n';
|
2018-04-08 02:30:37 +09:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-11-09 03:44:35 +09:00
|
|
|
i18n: i18n('desktop/views/components/renote-form-window.vue'),
|
2018-09-18 14:50:13 +09:00
|
|
|
props: {
|
|
|
|
note: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
animation: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
},
|
2018-09-18 05:35:06 +09:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
keymap(): any {
|
|
|
|
return {
|
|
|
|
'esc': this.close,
|
2018-09-18 14:39:18 +09:00
|
|
|
'enter': this.post,
|
|
|
|
'q': this.quote,
|
2018-09-18 05:35:06 +09:00
|
|
|
};
|
|
|
|
}
|
2018-04-08 02:30:37 +09:00
|
|
|
},
|
2018-09-18 05:35:06 +09:00
|
|
|
|
2018-04-08 02:30:37 +09:00
|
|
|
methods: {
|
2018-09-18 05:35:06 +09:00
|
|
|
post() {
|
|
|
|
(this.$refs.form as any).ok();
|
|
|
|
},
|
2018-09-18 14:39:18 +09:00
|
|
|
quote() {
|
|
|
|
(this.$refs.form as any).onQuote();
|
|
|
|
},
|
2018-09-18 05:35:06 +09:00
|
|
|
close() {
|
|
|
|
(this.$refs.window as any).close();
|
2018-04-08 02:30:37 +09:00
|
|
|
},
|
|
|
|
onPosted() {
|
|
|
|
(this.$refs.window as any).close();
|
|
|
|
},
|
|
|
|
onCanceled() {
|
|
|
|
(this.$refs.window as any).close();
|
2018-09-18 05:35:06 +09:00
|
|
|
},
|
|
|
|
onWindowClosed() {
|
|
|
|
this.$emit('closed');
|
|
|
|
this.destroyDom();
|
2018-04-08 02:30:37 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" module>
|
|
|
|
.header
|
2018-11-06 01:40:11 +09:00
|
|
|
> [data-icon]
|
2018-04-08 02:30:37 +09:00
|
|
|
margin-right 4px
|
|
|
|
|
|
|
|
</style>
|