1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-22 18:48:19 +09:00
MisskeyIO/src/client/app/desktop/views/components/renote-form-window.vue

50 lines
889 B
Vue
Raw Normal View History

2018-04-08 02:30:37 +09:00
<template>
<mk-window ref="window" is-modal @closed="onWindowClosed">
2018-04-15 01:04:40 +09:00
<span slot="header" :class="$style.header">%fa:retweet%%i18n:@title%</span>
<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';
export default Vue.extend({
props: ['note'],
computed: {
keymap(): any {
return {
'esc': this.close,
'ctrl+enter': this.post
};
}
2018-04-08 02:30:37 +09:00
},
2018-04-08 02:30:37 +09:00
methods: {
post() {
(this.$refs.form as any).ok();
},
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();
},
onWindowClosed() {
this.$emit('closed');
this.destroyDom();
2018-04-08 02:30:37 +09:00
}
}
});
</script>
<style lang="stylus" module>
.header
> [data-fa]
margin-right 4px
</style>