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

fix(popover): make it work with ngAnimate #3482

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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