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')