1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-02 23:19:57 +00:00

fix(publishWidget): add max height (#136)

This commit is contained in:
Chris 2022-11-27 01:20:30 +08:00 committed by GitHub
parent d4300d8d83
commit ad8b878120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,9 +16,10 @@ const {
expanded?: boolean expanded?: boolean
}>() }>()
let isExpanded = $ref(_expanded)
let isSending = $ref(false) let isSending = $ref(false)
let { draft } = $(useDraft(draftKey, inReplyToId)) let { draft } = $(useDraft(draftKey, inReplyToId))
const isExistDraft = $computed(() => !!draft.params.status && draft.params.status !== '<p></p>')
let isExpanded = $ref(isExistDraft || _expanded)
const { editor } = useTiptap({ const { editor } = useTiptap({
content: computed({ content: computed({
@ -180,7 +181,7 @@ onUnmounted(() => {
<div relative> <div relative>
<EditorContent <EditorContent
:editor="editor" :editor="editor"
:class="isExpanded ? 'min-h-120px' : ''" :class="isExpanded ? 'min-h-120px max-h-720px of-y-auto' : ''"
/> />
<div v-if="isExpanded" absolute right-0 bottom-0 pointer-events-none text-sm op25> <div v-if="isExpanded" absolute right-0 bottom-0 pointer-events-none text-sm op25>
{{ characterLimit - editor?.storage.characterCount.characters() }} {{ characterLimit - editor?.storage.characterCount.characters() }}
@ -254,7 +255,7 @@ onUnmounted(() => {
</CommonDropdown> </CommonDropdown>
<button <button
btn-solid rounded-full text-sm btn-solid rounded-full text-sm
:disabled="isUploading || (draft.attachments.length === 0 && !draft.params.status)" :disabled="!isExistDraft || isUploading || (draft.attachments.length === 0 && !draft.params.status)"
@click="publish" @click="publish"
> >
{{ !draft.editingStatus ? 'Publish!' : 'Save changes' }} {{ !draft.editingStatus ? 'Publish!' : 'Save changes' }}