Skip to content

Commit

Permalink
tooltip bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lvandeve committed Oct 24, 2022
1 parent 6f6d62b commit 4c01241
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ function showResource(i, special, index) {
// the label is set to e.g. 'info box: seeds', however the info inside it is more important, so set the label that screen readers read to the useful contents instead
setAriaLabel(div, label);

if(!div.tooltipadded) {
div.tooltipadded = true;
// compared with index because it can sometimes change (e.g. from amber to infinity seeds when unlucking infinity field)
if(div.tooltipadded != index) {
div.tooltipadded = index;
registerTooltip(div, function() {
return getResourceDetails(i, special, index);
}, /*opt_poll=*/true, /*allow_mobile=*/true);
Expand Down

0 comments on commit 4c01241

Please sign in to comment.