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

Commit dd62c73

Browse files
committed
fix(modal): switch to $animate
- Change to adding backdrop with $animate.addClass due to $animateCss issues when animation is disabled Closes #5585 Fixes #5298
1 parent 313ba83 commit dd62c73

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/modal/modal.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
103103
/**
104104
* A helper directive for the $modal service. It creates a backdrop element.
105105
*/
106-
.directive('uibModalBackdrop', ['$animateCss', '$injector', '$uibModalStack',
107-
function($animateCss, $injector, $modalStack) {
106+
.directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack',
107+
function($animate, $injector, $modalStack) {
108108
return {
109109
replace: true,
110110
templateUrl: 'uib/template/modal/backdrop.html',
@@ -116,16 +116,12 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
116116

117117
function linkFn(scope, element, attrs) {
118118
if (attrs.modalInClass) {
119-
$animateCss(element, {
120-
addClass: attrs.modalInClass
121-
}).start();
119+
$animate.addClass(element, attrs.modalInClass);
122120

123121
scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {
124122
var done = setIsAsync();
125123
if (scope.modalOptions.animation) {
126-
$animateCss(element, {
127-
removeClass: attrs.modalInClass
128-
}).start().then(done);
124+
$animate.removeClass(element, attrs.modalInClass).then(done);
129125
} else {
130126
done();
131127
}

0 commit comments

Comments
 (0)