Skip to content

Commit

Permalink
disable the discard button instead of hiding it
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-vorobiov committed Oct 3, 2024
1 parent 0fb617d commit 4c4f793
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion evolve_analytics.meta.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Evolve Analytics
// @namespace http://tampermonkey.net/
// @version 0.6.3
// @version 0.6.4
// @description Track and see detailed information about your runs
// @author Sneed
// @match https://pmotschmann.github.io/Evolve/
Expand Down
4 changes: 2 additions & 2 deletions src/ui/viewTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function makeViewTab(id: string, view: View, config: ConfigManager, histo

const discardRunNode = $(`<button class="button">Discard Run</button>`)
.on("click", () => { history.discardRun(selectedRun!); })
.hide();
.attr("disabled", "");

const asImageNode = $(`<button class="button">Copy as PNG</button>`)
.on("click", async () => {
Expand All @@ -90,7 +90,7 @@ export function makeViewTab(id: string, view: View, config: ConfigManager, histo

function onRunSelection(run: HistoryEntry | null) {
selectedRun = run;
discardRunNode.toggle(selectedRun !== null);
discardRunNode.attr("disabled", selectedRun === null ? "" : null);
}

const buttonsContainerNode = $(`<div style="display: flex; justify-content: space-between"></div>`)
Expand Down

0 comments on commit 4c4f793

Please sign in to comment.