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

Commit 972dee6

Browse files
committed
fix(modal): clean up animation when disabled
- When the animation is set to false, do not remove the `in` class to prevent black opaque background from showing Closes #4740 Fixes #4672
1 parent 38c1b14 commit 972dee6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Diff for: src/modal/modal.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,16 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
9090

9191
scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {
9292
var done = setIsAsync();
93-
if ($animateCss) {
94-
$animateCss(element, {
95-
removeClass: attrs.modalInClass
96-
}).start().then(done);
93+
if (scope.modalOptions.animation) {
94+
if ($animateCss) {
95+
$animateCss(element, {
96+
removeClass: attrs.modalInClass
97+
}).start().then(done);
98+
} else {
99+
$animate.removeClass(element, attrs.modalInClass).then(done);
100+
}
97101
} else {
98-
$animate.removeClass(element, attrs.modalInClass).then(done);
102+
done();
99103
}
100104
});
101105
}
@@ -413,7 +417,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
413417
backdrop: modal.backdrop,
414418
keyboard: modal.keyboard,
415419
openedClass: modal.openedClass,
416-
windowTopClass: modal.windowTopClass
420+
windowTopClass: modal.windowTopClass,
421+
animation: modal.animation
417422
});
418423

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

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

0 commit comments

Comments
 (0)