forked from rDrama/rDrama
fix this https://watchpeopledie.tv/h/meta/post/61549/megathread-for-bugs-and-suggestions/1987050#context
parent
412a032166
commit
75b9448c73
|
@ -450,6 +450,7 @@ else {
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertText(input, text) {
|
function insertText(input, text) {
|
||||||
|
if (input.value) text = ` ${text}`
|
||||||
const newPos = input.selectionStart + text.length;
|
const newPos = input.selectionStart + text.length;
|
||||||
input.setRangeText(text);
|
input.setRangeText(text);
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,7 @@ let commentFormID;
|
||||||
|
|
||||||
function insertGIF(url) {
|
function insertGIF(url) {
|
||||||
const commentBox = document.getElementById(commentFormID);
|
const commentBox = document.getElementById(commentFormID);
|
||||||
const old = commentBox.value;
|
insertText(commentBox, url)
|
||||||
let text
|
|
||||||
|
|
||||||
if (old) text = `${old}\n${url}`;
|
|
||||||
else text = url
|
|
||||||
|
|
||||||
insertText(commentBox, text)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gifModal = document.getElementById('gifModal')
|
const gifModal = document.getElementById('gifModal')
|
||||||
|
|
Loading…
Reference in New Issue