forked from rDrama/rDrama
focus textarea again when dismissing gif modal
parent
ac30328f89
commit
912911cf3d
|
@ -15,7 +15,9 @@ function insertGIF(url) {
|
||||||
if (typeof checkForRequired === "function") checkForRequired();
|
if (typeof checkForRequired === "function") checkForRequired();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('gifModal').addEventListener('shown.bs.modal', function () {
|
const gifModal = document.getElementById('gifModal')
|
||||||
|
|
||||||
|
gifModal.addEventListener('shown.bs.modal', function () {
|
||||||
focusSearchBar(gifSearchBar);
|
focusSearchBar(gifSearchBar);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
focusSearchBar(gifSearchBar);
|
focusSearchBar(gifSearchBar);
|
||||||
|
@ -109,6 +111,12 @@ async function show_gif_categories(form) {
|
||||||
for (const element of overlays) {
|
for (const element of overlays) {
|
||||||
element.addEventListener('click', () => {searchGifs(element.firstElementChild.innerHTML)});
|
element.addEventListener('click', () => {searchGifs(element.firstElementChild.innerHTML)});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gifModal.addEventListener('hide.bs.modal', () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
document.getElementById(commentFormID).focus();
|
||||||
|
}, 200);
|
||||||
|
}, {once : true});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('gifs-back-btn').addEventListener('click', show_gif_categories);
|
document.getElementById('gifs-back-btn').addEventListener('click', show_gif_categories);
|
||||||
|
|
Loading…
Reference in New Issue