Fix tooltips causing layout deformation

Fixes smogon/pokemon-showdown#6737
This commit is contained in:
Guangcong Luo
2020-05-25 18:12:01 -04:00
parent 45f7392ce9
commit d480780c33

View File

@@ -410,6 +410,12 @@ class BattleTooltips {
}
}
let width = $(BattleTooltips.elem).outerWidth()!;
if (x > document.documentElement.clientWidth - width - 2) {
x = document.documentElement.clientWidth - width - 2;
$wrapper.css('left', x);
}
BattleTooltips.parentElem = hoveredElem || null;
return true;
}