mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-24 03:28:11 +09:00
50 lines
889 B
Vue
50 lines
889 B
Vue
<template>
|
|
<mk-window ref="window" is-modal @closed="onWindowClosed">
|
|
<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"/>
|
|
</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
|
|
};
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
post() {
|
|
(this.$refs.form as any).ok();
|
|
},
|
|
close() {
|
|
(this.$refs.window as any).close();
|
|
},
|
|
onPosted() {
|
|
(this.$refs.window as any).close();
|
|
},
|
|
onCanceled() {
|
|
(this.$refs.window as any).close();
|
|
},
|
|
onWindowClosed() {
|
|
this.$emit('closed');
|
|
this.destroyDom();
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style lang="stylus" module>
|
|
.header
|
|
> [data-fa]
|
|
margin-right 4px
|
|
|
|
</style>
|