Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(tooltip): moves tooltip to the $rootElement rather than body or m…
Browse files Browse the repository at this point in the history
…d-content
  • Loading branch information
Robert Messerle committed Jun 3, 2015
1 parent 24ca296 commit 32b0fac
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 32b0fac

Please sign in to comment.