From 525994082c614f64ef90ea6162ccc27bec4171fa Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 24 Mar 2017 21:43:29 -0400 Subject: [PATCH] Support "top" placement so we can tooltip the navigation menu --- modules/ui/curtain.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/ui/curtain.js b/modules/ui/curtain.js index bbdedb219..e309b8bf9 100644 --- a/modules/ui/curtain.js +++ b/modules/ui/curtain.js @@ -96,8 +96,13 @@ export function uiCurtain() { pos = [box.left - 200, box.top + box.height / 2 - dimensions[1] / 2]; } else { - side = 'bottom'; - pos = [box.left, box.top + box.height]; + // need real tooltip height to calculate "top" placement + tooltip + .attr('class', 'curtain-tooltip tooltip in') + .call(uiToggle(true)); + var tip = tooltip.node().getBoundingClientRect(); + side = 'top'; + pos = [box.left + box.width / 2 - dimensions[0] / 2, box.top - tip.height]; } pos = [