From 75b9448c73514cc25f2c22484c255ba7dfcc1d57 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 31 Oct 2023 23:02:15 +0300 Subject: [PATCH] fix this https://watchpeopledie.tv/h/meta/post/61549/megathread-for-bugs-and-suggestions/1987050#context --- files/assets/js/core.js | 1 + files/assets/js/gif_modal.js | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 114773c2a..cf03681a8 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -450,6 +450,7 @@ else { } function insertText(input, text) { + if (input.value) text = ` ${text}` const newPos = input.selectionStart + text.length; input.setRangeText(text); diff --git a/files/assets/js/gif_modal.js b/files/assets/js/gif_modal.js index 6475b48de..6c0dbbdfb 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -6,13 +6,7 @@ let commentFormID; function insertGIF(url) { const commentBox = document.getElementById(commentFormID); - const old = commentBox.value; - let text - - if (old) text = `${old}\n${url}`; - else text = url - - insertText(commentBox, text) + insertText(commentBox, url) } const gifModal = document.getElementById('gifModal')