mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-07 09:29:59 +00:00
fix(publishWidget): add max height (#136)
This commit is contained in:
parent
d4300d8d83
commit
ad8b878120
1 changed files with 4 additions and 3 deletions
|
@ -16,9 +16,10 @@ const {
|
|||
expanded?: boolean
|
||||
}>()
|
||||
|
||||
let isExpanded = $ref(_expanded)
|
||||
let isSending = $ref(false)
|
||||
let { draft } = $(useDraft(draftKey, inReplyToId))
|
||||
const isExistDraft = $computed(() => !!draft.params.status && draft.params.status !== '<p></p>')
|
||||
let isExpanded = $ref(isExistDraft || _expanded)
|
||||
|
||||
const { editor } = useTiptap({
|
||||
content: computed({
|
||||
|
@ -180,7 +181,7 @@ onUnmounted(() => {
|
|||
<div relative>
|
||||
<EditorContent
|
||||
: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>
|
||||
{{ characterLimit - editor?.storage.characterCount.characters() }}
|
||||
|
@ -254,7 +255,7 @@ onUnmounted(() => {
|
|||
</CommonDropdown>
|
||||
<button
|
||||
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"
|
||||
>
|
||||
{{ !draft.editingStatus ? 'Publish!' : 'Save changes' }}
|
||||
|
|
Loading…
Reference in a new issue