aboutsummaryrefslogtreecommitdiff
path: root/src/app/js/mods.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-07-24 18:42:47 +0200
committer0neGal <mail@0negal.com>2023-07-24 18:42:47 +0200
commit8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf (patch)
treecdff3028a0310f61a493f1bff42aa7632d874e0e /src/app/js/mods.js
parent116fceaed48b4aace01290cee3ddfa007b2550f5 (diff)
downloadViper-8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf.tar.gz
Viper-8a47471ae6263aa78ed2a5c4e7a545c2e21c8bcf.zip
fixed updateable packages not being removeable
Diffstat (limited to 'src/app/js/mods.js')
-rw-r--r--src/app/js/mods.js9
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", () => {