summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-24 21:54:26 -0500
committerDessalines <tyhou13@gmx.com>2020-01-24 21:54:26 -0500
commit691d05222bc1009ec7373336ee097b2bcda5ada5 (patch)
tree54026a693ef8749ab98e98684324f6cf29eb92f8
parentec042d1d616735bc9117b9d47f9cf3c020111d8a (diff)
parent7e6842e63a84d8fa97135ec1d94342e5b10e5dc5 (diff)
Merge branch 'dev'
-rw-r--r--ui/src/components/comment-form.tsx6
-rw-r--r--ui/src/utils.ts2
2 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx
index f4eb1181..e4543d66 100644
--- a/ui/src/components/comment-form.tsx
+++ b/ui/src/components/comment-form.tsx
@@ -225,13 +225,15 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
.then(res => res.json())
.then(res => {
let url = `${window.location.origin}/pictshare/${res.url}`;
- let markdown =
+ let imageMarkdown =
res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`;
let content = i.state.commentForm.content;
- content = content ? `${content} ${markdown}` : markdown;
+ content = content ? `${content}\n${imageMarkdown}` : imageMarkdown;
i.state.commentForm.content = content;
i.state.imageLoading = false;
i.setState(i.state);
+ var textarea: any = document.getElementById(i.id);
+ autosize.update(textarea);
})
.catch(error => {
i.state.imageLoading = false;
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index 6a0ffdb3..7803ee4e 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -382,6 +382,8 @@ export function toast(text: string, background: string = 'success') {
Toastify({
text: text,
backgroundColor: backgroundColor,
+ gravity: 'bottom',
+ position: 'left',
}).showToast();
}