From dd62c73a1a731e3bba31fba8f74ae0c8fa216b39 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Sat, 5 Mar 2016 07:59:31 -0800 Subject: [PATCH] fix(modal): switch to $animate - Change to adding backdrop with $animate.addClass due to $animateCss issues when animation is disabled Closes #5585 Fixes #5298 --- src/modal/modal.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index 2c2511f1fa..ddd924ff47 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -103,8 +103,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) /** * A helper directive for the $modal service. It creates a backdrop element. */ - .directive('uibModalBackdrop', ['$animateCss', '$injector', '$uibModalStack', - function($animateCss, $injector, $modalStack) { + .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack', + function($animate, $injector, $modalStack) { return { replace: true, templateUrl: 'uib/template/modal/backdrop.html', @@ -116,16 +116,12 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) function linkFn(scope, element, attrs) { if (attrs.modalInClass) { - $animateCss(element, { - addClass: attrs.modalInClass - }).start(); + $animate.addClass(element, attrs.modalInClass); scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) { var done = setIsAsync(); if (scope.modalOptions.animation) { - $animateCss(element, { - removeClass: attrs.modalInClass - }).start().then(done); + $animate.removeClass(element, attrs.modalInClass).then(done); } else { done(); }