From c0fb637731684a644fd153875affbd4ecf492c8d Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 23:40:35 +0200 Subject: [PATCH] fix(webui): scroll position being reset when clicking on item options --- static/webui/script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 7fd9214d..c7a0cdc0 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -78,7 +78,8 @@ function updateInventory() { if (item.XP < 1_600_000) { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); addGearExp("Suits", item.ItemId.$oid, 1_600_000 - item.XP); }; a.textContent = "Make Rank 30"; @@ -91,7 +92,8 @@ function updateInventory() { { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); disposeOfGear("Suits", item.ItemId.$oid); }; a.textContent = "Remove"; @@ -117,7 +119,8 @@ function updateInventory() { if (item.XP < 800_000) { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); addGearExp(category, item.ItemId.$oid, 800_000 - item.XP); }; a.textContent = "Make Rank 30"; @@ -130,7 +133,8 @@ function updateInventory() { { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); disposeOfGear(category, item.ItemId.$oid); }; a.textContent = "Remove";