Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 461087b

Browse files
chrisirhcWesley Cho
authored and
Wesley Cho
committed
fix(popover): make it work with ngAnimate
Closes #3482 Fixes #3375
1 parent 8a55244 commit 461087b

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

Diff for: src/tooltip/tooltip.js

+21
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,27 @@ function ($animate , $sce , $compile , $templateRequest) {
421421
};
422422
}])
423423

424+
// Apply animate class without animating itself
425+
.directive('tooltipAnimateClass', function () {
426+
return {
427+
restrict: 'A',
428+
link: function (scope, element, attrs) {
429+
if (scope.animation()) {
430+
element.addClass(attrs.tooltipAnimateClass);
431+
}
432+
}
433+
};
434+
})
435+
436+
.directive('tooltipPlacementClass', function () {
437+
return {
438+
restrict: 'A',
439+
link: function (scope, element, attrs) {
440+
element.addClass(scope.placement);
441+
}
442+
};
443+
})
444+
424445
.directive( 'tooltipPopup', function () {
425446
return {
426447
restrict: 'EA',

Diff for: template/popover/popover-template.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">
1+
<div class="popover"
2+
tooltip-placement-class
3+
tooltip-animate-class="fade"
4+
ng-class="{ in: isOpen() }">
25
<div class="arrow"></div>
36

47
<div class="popover-inner">

Diff for: template/popover/popover.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">
1+
<div class="popover"
2+
tooltip-placement-class
3+
tooltip-animate-class="fade"
4+
ng-class="{ in: isOpen() }">
25
<div class="arrow"></div>
36

47
<div class="popover-inner">

0 commit comments

Comments
 (0)