Aevann 2023-10-31 23:02:15 +03:00
parent 412a032166
commit 75b9448c73
2 changed files with 2 additions and 7 deletions

View File

@ -450,6 +450,7 @@ else {
}
function insertText(input, text) {
if (input.value) text = ` ${text}`
const newPos = input.selectionStart + text.length;
input.setRangeText(text);

View File

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