2018-04-07 12:30:37 -05:00
|
|
|
<template>
|
2018-09-17 15:35:06 -05:00
|
|
|
<mk-window ref="window" is-modal @closed="onWindowClosed">
|
2018-04-14 11:04:40 -05:00
|
|
|
<span slot="header" :class="$style.header">%fa:retweet%%i18n:@title%</span>
|
2018-09-17 15:35:06 -05:00
|
|
|
<mk-renote-form ref="form" :note="note" @posted="onPosted" @canceled="onCanceled" v-hotkey.global="keymap"/>
|
2018-04-07 12:30:37 -05:00
|
|
|
</mk-window>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
props: ['note'],
|
2018-09-17 15:35:06 -05:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
keymap(): any {
|
|
|
|
return {
|
|
|
|
'esc': this.close,
|
|
|
|
'ctrl+enter': this.post
|
|
|
|
};
|
|
|
|
}
|
2018-04-07 12:30:37 -05:00
|
|
|
},
|
2018-09-17 15:35:06 -05:00
|
|
|
|
2018-04-07 12:30:37 -05:00
|
|
|
methods: {
|
2018-09-17 15:35:06 -05:00
|
|
|
post() {
|
|
|
|
(this.$refs.form as any).ok();
|
|
|
|
},
|
|
|
|
close() {
|
|
|
|
(this.$refs.window as any).close();
|
2018-04-07 12:30:37 -05:00
|
|
|
},
|
|
|
|
onPosted() {
|
|
|
|
(this.$refs.window as any).close();
|
|
|
|
},
|
|
|
|
onCanceled() {
|
|
|
|
(this.$refs.window as any).close();
|
2018-09-17 15:35:06 -05:00
|
|
|
},
|
|
|
|
onWindowClosed() {
|
|
|
|
this.$emit('closed');
|
|
|
|
this.destroyDom();
|
2018-04-07 12:30:37 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" module>
|
|
|
|
.header
|
|
|
|
> [data-fa]
|
|
|
|
margin-right 4px
|
|
|
|
|
|
|
|
</style>
|