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

Commit

Permalink
fix(modal): clean up animation when disabled
Browse files Browse the repository at this point in the history
- When the animation is set to false, do not remove the `in` class to prevent black opaque background from showing

Closes #4740
Fixes #4672
  • Loading branch information
wesleycho committed Oct 26, 2015
1 parent 38c1b14 commit 972dee6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])

scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {
var done = setIsAsync();
if ($animateCss) {
$animateCss(element, {
removeClass: attrs.modalInClass
}).start().then(done);
if (scope.modalOptions.animation) {
if ($animateCss) {
$animateCss(element, {
removeClass: attrs.modalInClass
}).start().then(done);
} else {
$animate.removeClass(element, attrs.modalInClass).then(done);
}
} else {
$animate.removeClass(element, attrs.modalInClass).then(done);
done();
}
});
}
Expand Down Expand Up @@ -413,7 +417,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
backdrop: modal.backdrop,
keyboard: modal.keyboard,
openedClass: modal.openedClass,
windowTopClass: modal.windowTopClass
windowTopClass: modal.windowTopClass,
animation: modal.animation
});

openedClasses.put(modalBodyClass, modalInstance);
Expand All @@ -423,6 +428,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])

if (currBackdropIndex >= 0 && !backdropDomEl) {
backdropScope = $rootScope.$new(true);
backdropScope.modalOptions = modal;
backdropScope.index = currBackdropIndex;
var angularBackgroundDomEl = angular.element('<div uib-modal-backdrop="modal-backdrop"></div>');
angularBackgroundDomEl.attr('backdrop-class', modal.backdropClass);
Expand Down

0 comments on commit 972dee6

Please sign in to comment.