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

fix(modal): switch to $animate #5585

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 4 additions & 8 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
}
Expand Down