diff --git a/files/assets/js/gif_modal.js b/files/assets/js/gif_modal.js index 56ad8e812..9214812ec 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -1,3 +1,9 @@ +document.addEventListener("DOMContentLoaded", function () { + document.querySelectorAll('[data-src]').forEach(elem => { + elem.src = elem.dataset.src; + }) +}); + async function getGif(searchTerm) { if (searchTerm !== undefined) { @@ -24,7 +30,7 @@ async function getGif(searchTerm) { container.innerHTML = ''; if (searchTerm == undefined) { - container.innerHTML = '
' + container.innerHTML = ' ' backBtn.innerHTML = null; @@ -54,10 +60,10 @@ async function getGif(searchTerm) { for (var i = 0; i < 48; i++) { gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/200w_d.webp"; if (data[i].username==''){ - container.innerHTML += (' '); + container.innerHTML += (' '); } else { - container.innerHTML += (' '); + container.innerHTML += (' '); } noGIFs.innerHTML = null; loadGIFs.innerHTML = 'Thou've reached the end of the list!