From 8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 24 Jul 2023 18:42:47 +0200 Subject: fixed updateable packages not being removeable --- src/app/js/mods.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/js/mods.js b/src/app/js/mods.js index 2df7205..0d516d9 100644 --- a/src/app/js/mods.js +++ b/src/app/js/mods.js @@ -69,7 +69,7 @@ mods.load = (mods_obj) => { `; - div.querySelector(".remove").addEventListener("click", () => { + div.querySelector(".remove").onclick = () => { if (! mod.package) { return mods.remove(mod.name); } @@ -77,7 +77,7 @@ mods.load = (mods_obj) => { for (let i = 0; i < mod.packaged_mods.length; i++) { mods.remove(mod.packaged_mods[i]); } - }) + } if (mod.disabled) { div.querySelector(".switch").classList.remove("on"); @@ -123,7 +123,6 @@ mods.load = (mods_obj) => { return; } - let image_container = mod_els[i].querySelector(".image"); let image_el = image_container.querySelector("img") let image_blur_el = image_container.querySelector("img.blur") @@ -158,6 +157,10 @@ mods.load = (mods_obj) => { let mod_el = mod_els[i].cloneNode(true); + // copy click event of the remove button to the new button + mod_el.querySelector(".remove").onclick = + mod_els[i].querySelector(".remove").onclick; + mod_el.classList.add("no-animation"); mod_el.querySelector(".switch").addEventListener("click", () => { -- cgit v1.2.3