mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 00:37:47 +00:00
TSK-858: Send picture without text as comment for issues (#2793)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
26052dca3e
commit
8ffc0b683a
@ -285,9 +285,11 @@
|
|||||||
bind:isEmpty
|
bind:isEmpty
|
||||||
bind:this={textEditor}
|
bind:this={textEditor}
|
||||||
on:content={(ev) => {
|
on:content={(ev) => {
|
||||||
dispatch('message', ev.detail)
|
if (!isEmpty || haveAttachment) {
|
||||||
content = ''
|
dispatch('message', ev.detail)
|
||||||
textEditor.clear()
|
content = ''
|
||||||
|
textEditor.clear()
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
extensions={editorExtensions}
|
extensions={editorExtensions}
|
||||||
on:selection-update={updateFormattingState}
|
on:selection-update={updateFormattingState}
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
export let full = false
|
export let full = false
|
||||||
|
|
||||||
let textEditor: TextEditor
|
let textEditor: TextEditor
|
||||||
|
let isEmpty = true
|
||||||
|
|
||||||
export function submit (): void {
|
export function submit (): void {
|
||||||
textEditor.submit()
|
textEditor.submit()
|
||||||
@ -487,6 +488,7 @@
|
|||||||
bind:content
|
bind:content
|
||||||
{placeholder}
|
{placeholder}
|
||||||
bind:this={textEditor}
|
bind:this={textEditor}
|
||||||
|
bind:isEmpty
|
||||||
on:value
|
on:value
|
||||||
on:content={(ev) => {
|
on:content={(ev) => {
|
||||||
dispatch('message', ev.detail)
|
dispatch('message', ev.detail)
|
||||||
@ -504,6 +506,7 @@
|
|||||||
bind:content
|
bind:content
|
||||||
{placeholder}
|
{placeholder}
|
||||||
bind:this={textEditor}
|
bind:this={textEditor}
|
||||||
|
bind:isEmpty
|
||||||
on:value
|
on:value
|
||||||
on:content={(ev) => {
|
on:content={(ev) => {
|
||||||
dispatch('message', ev.detail)
|
dispatch('message', ev.detail)
|
||||||
|
@ -50,10 +50,8 @@
|
|||||||
if (editor) editor.setEditable(editable)
|
if (editor) editor.setEditable(editable)
|
||||||
}
|
}
|
||||||
export function submit (): void {
|
export function submit (): void {
|
||||||
if (!editor.isEmpty) {
|
content = editor.getHTML()
|
||||||
content = editor.getHTML()
|
dispatch('content', content)
|
||||||
dispatch('content', content)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export function setContent (newContent: string): void {
|
export function setContent (newContent: string): void {
|
||||||
if (content !== newContent) {
|
if (content !== newContent) {
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
const attachments: AttachmentStyledBox[] = []
|
const attachments: AttachmentStyledBox[] = []
|
||||||
const edits: TextEditor[] = []
|
const edits: TextEditor[] = []
|
||||||
let hasAttachments: boolean = false
|
let hasAttachments: boolean = false
|
||||||
|
const isEmpty: boolean[] = [true]
|
||||||
const expanded: boolean[] = []
|
const expanded: boolean[] = []
|
||||||
items.forEach(() => expanded.push(false))
|
items.forEach(() => expanded.push(false))
|
||||||
|
|
||||||
@ -86,13 +87,16 @@
|
|||||||
<TextEditor
|
<TextEditor
|
||||||
bind:content={item.content}
|
bind:content={item.content}
|
||||||
bind:this={edits[i]}
|
bind:this={edits[i]}
|
||||||
|
bind:isEmpty={isEmpty[i]}
|
||||||
on:value={(ev) => {
|
on:value={(ev) => {
|
||||||
dispatch('update', { item, value: ev.detail })
|
dispatch('update', { item, value: ev.detail })
|
||||||
}}
|
}}
|
||||||
on:content={(ev) => {
|
on:content={(ev) => {
|
||||||
items[i].content = ev.detail
|
if (!isEmpty[i]) {
|
||||||
dispatch('update', { item, value: ev.detail })
|
items[i].content = ev.detail
|
||||||
flip(i)
|
dispatch('update', { item, value: ev.detail })
|
||||||
|
flip(i)
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
on:blur={() => dispatch('blur', item)}
|
on:blur={() => dispatch('blur', item)}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user