forked from misskey-dev/misskey
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
135 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
<template> | ||
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="$refs.modal.close()" @closed="$emit('closed')"> | ||
<MkPostForm v-bind="$attrs" @posted="$refs.modal.close()" @cancel="$refs.modal.close()" @esc="$refs.modal.close()"/> | ||
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="modal.close()" @closed="onModalClosed()"> | ||
<MkPostForm ref="form" v-bind="props" autofocus freeze-after-posted @posted="onPosted" @cancel="modal.close()" @esc="modal.close()"/> | ||
</MkModal> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { } from 'vue'; | ||
import * as misskey from 'misskey-js'; | ||
import MkModal from '@/components/MkModal.vue'; | ||
import MkPostForm from '@/components/MkPostForm.vue'; | ||
export default defineComponent({ | ||
components: { | ||
MkModal, | ||
MkPostForm, | ||
}, | ||
emits: ['closed'], | ||
}); | ||
const props = defineProps<{ | ||
reply?: misskey.entities.Note; | ||
renote?: misskey.entities.Note; | ||
channel?: any; // TODO | ||
mention?: misskey.entities.User; | ||
specified?: misskey.entities.User; | ||
initialText?: string; | ||
initialVisibility?: typeof misskey.noteVisibilities; | ||
initialFiles?: misskey.entities.DriveFile[]; | ||
initialLocalOnly?: boolean; | ||
initialVisibleUsers?: misskey.entities.User[]; | ||
initialNote?: misskey.entities.Note; | ||
instant?: boolean; | ||
fixed?: boolean; | ||
autofocus?: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(ev: 'closed'): void; | ||
}>(); | ||
let modal = $ref<InstanceType<typeof MkModal>>(); | ||
let form = $ref<InstanceType<typeof MkPostForm>>(); | ||
function onPosted() { | ||
modal.close({ | ||
useSendAnimation: true, | ||
}); | ||
} | ||
function onModalClosed() { | ||
emit('closed'); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters