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

Commit

Permalink
fix(modal): switch to $animate
Browse files Browse the repository at this point in the history
- Change to adding backdrop with $animate.addClass due to $animateCss
  issues when animation is disabled

Closes #5585
Fixes #5298
  • Loading branch information
wesleycho committed Mar 5, 2016
1 parent 313ba83 commit dd62c73
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit dd62c73

Please sign in to comment.