From 4c4f793ef7a2e6e437577c90cddd0e8597925188 Mon Sep 17 00:00:00 2001 From: romanv Date: Fri, 4 Oct 2024 00:32:57 +0200 Subject: [PATCH] disable the discard button instead of hiding it --- evolve_analytics.meta.js | 2 +- src/ui/viewTab.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evolve_analytics.meta.js b/evolve_analytics.meta.js index 5a531a0..03b435f 100644 --- a/evolve_analytics.meta.js +++ b/evolve_analytics.meta.js @@ -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/ diff --git a/src/ui/viewTab.ts b/src/ui/viewTab.ts index 5e87e50..f927e39 100644 --- a/src/ui/viewTab.ts +++ b/src/ui/viewTab.ts @@ -80,7 +80,7 @@ export function makeViewTab(id: string, view: View, config: ConfigManager, histo const discardRunNode = $(``) .on("click", () => { history.discardRun(selectedRun!); }) - .hide(); + .attr("disabled", ""); const asImageNode = $(``) .on("click", async () => { @@ -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 = $(`
`)