diff --git a/static/webui/index.html b/static/webui/index.html index 0401dcc7..a3121f97 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -467,7 +467,9 @@
- +
@@ -494,7 +496,6 @@ - diff --git a/static/webui/script.js b/static/webui/script.js index 94a7ba33..be6dcb05 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -195,9 +195,9 @@ function fetchItemList() { items.forEach(item => { if (item.uniqueName.startsWith("RadioLegion")) item.name += " (" + item.uniqueName + ")"; const option = document.createElement("option"); - option.setAttribute("data-key", item.uniqueName); - option.value = item.name; - document.getElementById("datalist-" + type).appendChild(option); + option.value = item.uniqueName; + option.innerHTML = item.name; + document.getElementById("changeSyndicate").appendChild(option); itemMap[item.uniqueName] = { ...item, type }; }); } else if (type != "badItems") { @@ -537,6 +537,7 @@ function updateInventory() { document.querySelector("label[for='changeSyndicate']").innerText = loc("cheats_changeSupportedSyndicate") .split("|SYNDICATE|") .join(itemMap[data.SupportedSyndicate]?.name || loc("cheats_none")); + document.getElementById("changeSyndicate").value = data.SupportedSyndicate ?? ""; }); }); } @@ -1111,7 +1112,7 @@ function doImport() { } function doChangeSupportedSyndicate() { - const uniqueName = getKey(document.getElementById("changeSyndicate")) ?? ""; + const uniqueName = document.querySelector("#changeSyndicate option:checked").value; revalidateAuthz(() => { $.get("/api/setSupportedSyndicate.php?" + window.authz + "&syndicate=" + uniqueName).done(function () { document.getElementById("changeSyndicate").value = "";