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

Commit

Permalink
fix(popover): make it work with ngAnimate
Browse files Browse the repository at this point in the history
Closes #3482
Fixes #3375
  • Loading branch information
chrisirhc authored and Wesley Cho committed Apr 6, 2015
1 parent 8a55244 commit 461087b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
21 changes: 21 additions & 0 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,27 @@ function ($animate , $sce , $compile , $templateRequest) {
};
}])

// Apply animate class without animating itself
.directive('tooltipAnimateClass', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
if (scope.animation()) {
element.addClass(attrs.tooltipAnimateClass);
}
}
};
})

.directive('tooltipPlacementClass', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.addClass(scope.placement);
}
};
})

.directive( 'tooltipPopup', function () {
return {
restrict: 'EA',
Expand Down
5 changes: 4 additions & 1 deletion template/popover/popover-template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">
<div class="popover"
tooltip-placement-class
tooltip-animate-class="fade"
ng-class="{ in: isOpen() }">
<div class="arrow"></div>

<div class="popover-inner">
Expand Down
5 changes: 4 additions & 1 deletion template/popover/popover.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">
<div class="popover"
tooltip-placement-class
tooltip-animate-class="fade"
ng-class="{ in: isOpen() }">
<div class="arrow"></div>

<div class="popover-inner">
Expand Down

0 comments on commit 461087b

Please sign in to comment.