From bffa624ccc6593fde2ee79e02e415c82a89d2c15 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Sun, 6 Dec 2020 23:40:06 -0500 Subject: [PATCH] Respec buttons and layer nodes don't keep focus --- changelog.md | 2 ++ js/utils.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 751b2d0..01c4ebb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,8 @@ # The Modding Tree changelog: +- Added achievement/milestone popups (thank you to Jacorb for this contribution!) - The changelog tab is back, and can be set in mod.js. +- Layer nodes and respec buttons are unselected after clicking them so you don't accidentally press them again with "enter". - The victory screen text is configurable. - Added an argument to use specific rows in an "upgrades" component. - Added the ability to easily make a tab that is a collection of layers in subtabs. diff --git a/js/utils.js b/js/utils.js index b22331c..693ebf8 100644 --- a/js/utils.js +++ b/js/utils.js @@ -456,6 +456,7 @@ function respecBuyables(layer) { if (!confirm("Are you sure you want to respec? This will force you to do a \"" + (tmp[layer].name ? tmp[layer].name : layer) + "\" reset as well!")) return layers[layer].buyables.respec() updateBuyableTemp(layer) + document.activeElement.blur() } function canAffordUpgrade(layer, id) { @@ -641,6 +642,7 @@ function showTab(name) { if (player.navTab == "none" && (tmp[name].row !== "side") && (tmp[name].row !== "otherside")) player.lastSafeTab = name delete player.notify[name] needCanvasUpdate = true + document.activeElement.blur() } function showNavTab(name) {