diff options
author | 0neGal <mail@0negal.com> | 2023-07-24 18:42:47 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-07-24 18:42:47 +0200 |
commit | 8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf (patch) | |
tree | cdff3028a0310f61a493f1bff42aa7632d874e0e | |
parent | 116fceaed48b4aace01290cee3ddfa007b2550f5 (diff) | |
download | Viper-8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf.tar.gz Viper-8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf.zip |
fixed updateable packages not being removeable
-rw-r--r-- | src/app/js/mods.js | 9 |
1 files 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> `; - 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", () => { |