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

fix(modal): clean up animation when disabled #4740

Closed
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
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