From fad9a94c4959e216520fe0eae492f93c0dd23489 Mon Sep 17 00:00:00 2001 From: Surekha Shelake Date: Thu, 20 Jul 2017 10:06:25 +0530 Subject: [PATCH] fix:tooltip:change to make tooltip work when document contains multiple body tags --- src/tooltip/tooltip.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index dd02a077a1..1972e999e1 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -328,7 +328,8 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s tooltipLinkedScope = ttScope.$new(); tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) { if (appendToBody) { - $document.find('body').append(tooltip); + //https://github.com/angular-ui/bootstrap/issues/6597 + angular.element(document.body).append(tooltip); } else { element.after(tooltip); } @@ -348,7 +349,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s if (tooltip) { tooltip.remove(); - + tooltip = null; if (adjustmentTimeout) { $timeout.cancel(adjustmentTimeout); @@ -356,7 +357,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s } openedTooltips.remove(ttScope); - + if (tooltipLinkedScope) { tooltipLinkedScope.$destroy(); tooltipLinkedScope = null;