« get me outta code hell

client: consider default tooltip placement as down-right - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 17:24:16 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:13 -0300
commit1582b1e3a58cfccf3d8b7f636693ac57a91aa3dc (patch)
treeecb58bce548cb4b59eff8c1b44219f318d2bfe68 /src/static
parent77ce1001a972bb3635f734c96324766c0c4ecd94 (diff)
client: consider default tooltip placement as down-right
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/client.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/static/js/client.js b/src/static/js/client.js
index 83459932..8299b63e 100644
--- a/src/static/js/client.js
+++ b/src/static/js/client.js
@@ -1765,6 +1765,11 @@ function showTooltipFromHoverable(hoverable) {
 
   positionTooltipFromHoverableWithBrains(hoverable);
 
+  // After a tooltip is shown, if we *didn't* specify an anchor,
+  // assume it was shown in its default position - generally presented
+  // as down and to the right. Successive repositioning will base on this.
+  state.dynamicTooltipAnchorDirection ??= ['down', 'right'];
+
   cssProp(tooltip, 'display', 'block');
   tooltip.inert = false;