From 1dfd3f46acd6ac710599e6177b8716d5e1a87d51 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 26 Apr 2017 09:36:20 -0400 Subject: [PATCH] Put the tooltip near the Residential Road button (closes #3985) --- modules/ui/intro/line.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/ui/intro/line.js b/modules/ui/intro/line.js index cd8ba272e..2ce73f1f4 100644 --- a/modules/ui/intro/line.js +++ b/modules/ui/intro/line.js @@ -286,10 +286,18 @@ export function uiIntroLine(context, reveal) { }); timeout(function() { - reveal(subgrid.node(), + var tooltip = reveal(subgrid.node(), t('intro.lines.choose_preset_residential', { preset: residentialPreset.name() }), { duration: 300 } ); + + // put the tooltip near the "Residential Road" button + var button = d3.select('.preset-highway-residential .preset-list-button').node(); + var buttonRect = button.getBoundingClientRect(); + var tooltipRect = tooltip.node().getBoundingClientRect(); + var top = buttonRect.top - (tooltipRect.height / 2) + (buttonRect.height / 2); + tooltip.style('top', top + 'px'); + }, 300); function continueTo(nextStep) {