Skip to content

Commit 6f6e19e

Browse files
author
Chris K
committed
Let hide close the tooltip if one of the contexts is the calling one.
1 parent ff3f1df commit 6f6e19e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/ui-scripts/tooltip/tooltip.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,24 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected";
369369

370370
var _hide_tooltip = function(tooltip)
371371
{
372-
if (_cur_ctx && _cur_ctx.current_tooltip &&
373-
tooltip == _cur_ctx.current_tooltip &&
374-
_cur_ctx.accept_call)
372+
if (!_cur_ctx)
373+
return;
374+
375+
var index = _ctx_stack.length - 1;
376+
var ctx = _ctx_stack[index];
377+
var accept_call = ctx.accept_call;
378+
while (accept_call && ctx && index > -1)
375379
{
376-
_cur_ctx.hide_tooltip(true);
380+
if (ctx.current_tooltip && tooltip == ctx.current_tooltip)
381+
{
382+
while (_ctx_stack.length > index + 1)
383+
_ctx_stack.pop().hide_tooltip(true);
384+
385+
ctx.hide_tooltip(true);
386+
_cur_ctx = ctx;
387+
break;
388+
}
389+
ctx = _ctx_stack[--index]
377390
}
378391
};
379392

0 commit comments

Comments
 (0)