From 32b0facc0b971f12f777f8f7b7392db1e5c5e091 Mon Sep 17 00:00:00 2001 From: Robert Messerle Date: Tue, 2 Jun 2015 17:37:21 -0700 Subject: [PATCH] fix(tooltip): moves tooltip to the $rootElement rather than body or md-content --- src/components/tooltip/tooltip.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/tooltip/tooltip.js b/src/components/tooltip/tooltip.js index d604c0afe19..f41416b8d18 100644 --- a/src/components/tooltip/tooltip.js +++ b/src/components/tooltip/tooltip.js @@ -33,7 +33,8 @@ angular * @param {string=} md-direction Which direction would you like the tooltip to go? Supports left, right, top, and bottom. Defaults to bottom. * @param {boolean=} md-autohide If present or provided with a boolean value, the tooltip will hide on mouse leave, regardless of focus */ -function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdTheming, $animate, $q) { +function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdTheming, $rootElement, + $animate, $q) { var TOOLTIP_SHOW_DELAY = 300; var TOOLTIP_WINDOW_EDGE_SPACE = 8; @@ -111,13 +112,7 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe } function getNearestContentElement () { - var current = element.parent()[0]; - // Look for the nearest parent md-content - while (current && current !== document.body) { - if (current.tagName && current.tagName.toLowerCase() == 'md-content') break; - current = current.parentNode; - } - return current; + return $rootElement; } function hasComputedStyleValue(key, value) {