Skip to content

Commit

Permalink
Fix bug where custom buy text input was disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stampyzfanz committed Feb 2, 2024
1 parent d0f2361 commit 064770d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/aspecttree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ SharkGame.AspectTree = {
row.attr("data-aspectId", aspectId)
.on("click", clickCallback)
.attr("aria-role", "button")
.attr("disabled", reqref.prereqsMet.toString());
.attr("disabled", reqref.prereqsMet ? "true" : null);
});

tableBody.append(aspectTableDescriptionRow);
Expand Down
2 changes: 1 addition & 1 deletion src/keybinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ SharkGame.Keybinds = {
case "switch to buy custom":
if (!$("#buy-custom").hasClass("disabled")) {
SharkGame.Settings.current.buyAmount = "custom";
$("#custom-input").attr("disabled", "false");
$("#custom-input").attr("disabled", null);
$("button[id^='buy-']").removeClass("disabled");
$("#buy-custom").addClass("disabled");
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ Mod of v ${SharkGame.ORIGINAL_VERSION}`
const thisButton = $(this);
if (thisButton.hasClass("disabled")) return;
if (thisButton[0].id === "buy-custom") {
$("#custom-input").attr("disabled", "false");
$("#custom-input").attr("disabled", null);
} else {
$("#custom-input").attr("disabled", "true");
}
Expand All @@ -797,7 +797,7 @@ Mod of v ${SharkGame.ORIGINAL_VERSION}`
.attr("id", "custom-input")
.attr("value", 1)
.attr("min", "1")
.attr("disabled", (SharkGame.Settings.current.buyAmount !== "custom").toString())
.attr("disabled", SharkGame.Settings.current.buyAmount !== "custom" ? "true" : null)
)
);
document.getElementById("custom-input")!.addEventListener("input", main.onCustomChange);
Expand Down

0 comments on commit 064770d

Please sign in to comment.