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

Commit

Permalink
fix(tooltip): tooltip will attach to the body rather than $rootElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Jun 2, 2015
1 parent d2f8555 commit 24ca296
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ 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, $rootElement, $animate, $q) {
function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdTheming, $animate, $q) {

var TOOLTIP_SHOW_DELAY = 300;
var TOOLTIP_WINDOW_EDGE_SPACE = 8;
Expand Down Expand Up @@ -112,8 +112,8 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe

function getNearestContentElement () {
var current = element.parent()[0];
// Look for the nearest parent md-content, stopping at the rootElement.
while (current && current !== $rootElement[0] && current !== document.body) {
// Look for the nearest parent md-content
while (current && current !== document.body) {
if (current.tagName && current.tagName.toLowerCase() == 'md-content') break;
current = current.parentNode;
}
Expand Down

0 comments on commit 24ca296

Please sign in to comment.