aboutsummaryrefslogtreecommitdiff
path: root/src/app/main.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-03 00:54:03 +0100
committer0neGal <mail@0negal.com>2022-01-03 00:54:03 +0100
commita210128d806bb1479c25198fa2399df99ee92bd0 (patch)
tree08eea8ce17f3afcbeee85fa832ad46cc1cd44b20 /src/app/main.js
parentbf7bd0993714f20fd0ab360de956378113e1d9c2 (diff)
downloadViper-a210128d806bb1479c25198fa2399df99ee92bd0.tar.gz
Viper-a210128d806bb1479c25198fa2399df99ee92bd0.zip
improved visuals of disabled tag
Diffstat (limited to 'src/app/main.js')
-rw-r--r--src/app/main.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/app/main.js b/src/app/main.js
index f903c29..897c82c 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -47,7 +47,7 @@ function setButtons(state) {
let lastselected = "";
function select(entry) {
- let entries = document.querySelectorAll("#modsdiv .mod span");
+ let entries = document.querySelectorAll("#modsdiv .mod .modtext");
for (let i = 0; i < entries.length; i++) {
if (entries[i].innerHTML == entry) {
@@ -64,7 +64,7 @@ function selected(all) {
if (all) {
selected = "allmods"
} else {
- selected = document.querySelector(".mod.selected span");
+ selected = document.querySelector(".mod.selected .modtext");
if (selected != null) {
selected = selected.innerHTML;
} else {
@@ -110,9 +110,14 @@ ipcRenderer.on("mods", (event, mods) => {
modcount.innerHTML = `${lang("gui.mods.count")} ${mods.all.length}`;
modsdiv.innerHTML = "";
- let newmod = (name, extra) => {
- if (! extra) {extra = ""}
- modsdiv.innerHTML += `<div onclick="select('${name}')" class="mod"><span>${name}</span>${extra}</div>`;
+ let newmod = (name, disabled) => {
+ if (disabled) {
+ disabled = `<span class="disabled">${lang("gui.mods.disabledtag")}</span>`
+ } else {
+ disabled = ""
+ }
+
+ modsdiv.innerHTML += `<div onclick="select('${name}')" class="mod"><span class="modtext">${name}</span>${disabled}</div>`;
}
for (let i = 0; i < mods.enabled.length; i++) {newmod(mods.enabled[i].Name)}