From a1877b2d34c92f7d38c55eea2aef514cc04e92dd Mon Sep 17 00:00:00 2001 From: Sashank999 Date: Sat, 24 Aug 2024 19:37:50 +0530 Subject: [PATCH] Fix Job Points Tooltip and show it on mobile. --- extension/changelog.json | 3 ++- .../scripts/features/jobpoints-tooltip/ttJobPointsToolTip.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extension/changelog.json b/extension/changelog.json index 48b7f8da4..9c0137b4e 100644 --- a/extension/changelog.json +++ b/extension/changelog.json @@ -9,7 +9,8 @@ { "message": "Avoid crashing the page when opening the torntools settings on some pages.", "contributor": "DeKleineKobini" }, { "message": "Fix query selectors on the gym page after Torn's frontend update.", "contributor": "Kwack" }, { "message": "Fix Cooldown End Times after Torn's frontend update.", "contributor": "TheFoxMan" }, - { "message": "Show the gym stat requirements per stat after switching gyms.", "contributor": "DeKleineKobini" } + { "message": "Show the gym stat requirements per stat after switching gyms.", "contributor": "DeKleineKobini" }, + { "message": "Fix Job Points Tooltip and show it on mobile.", "contributor": "TheFoxMan" } ], "changes": [{ "message": "Faction selection of a filter stays even when faction members do not exist in list.", "contributor": "TheFoxMan" }], "removed": [] diff --git a/extension/scripts/features/jobpoints-tooltip/ttJobPointsToolTip.js b/extension/scripts/features/jobpoints-tooltip/ttJobPointsToolTip.js index 6218ab6c0..946e89419 100644 --- a/extension/scripts/features/jobpoints-tooltip/ttJobPointsToolTip.js +++ b/extension/scripts/features/jobpoints-tooltip/ttJobPointsToolTip.js @@ -33,7 +33,7 @@ async function addJobPointsTooltip() { await requireSidebar(); - const jobIcon = await requireElement("#sidebarroot a[href*='/job']"); + const jobIcon = await requireElement("#sidebarroot [class*='status-icons__'] a[href*='/job']"); jobIcon.addEventListener("mouseover", tooltipListener); } @@ -43,7 +43,7 @@ await sleep(200); // Tooltip transition duration from one icon's tooltip information to another icon's tooltip information - const tooltipEl = (await requireElement("body > [id*='floating-ui-']")).find("[class*='tooltip__']"); + const tooltipEl = (await requireElement("body > div[id][data-floating-ui-portal]")).find("[class*='tooltip__']"); const tooltipBodyEl = tooltipEl.getElementsByTagName("p")[0]; const tooltipBodyText = tooltipBodyEl.textContent;