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

Commit 672a557

Browse files
plainkeymanpkozlowski-opensource
authored andcommitted
fix(modal): properly animate backdrops on each modal opening
Closes #1267
1 parent d168589 commit 672a557

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/modal/modal.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ angular.module('ui.bootstrap.modal', [])
6262
restrict: 'EA',
6363
replace: true,
6464
templateUrl: 'template/modal/backdrop.html',
65-
link: function (scope, element, attrs) {
65+
link: function (scope) {
66+
67+
scope.animate = false;
6668

6769
//trigger CSS transitions
6870
$timeout(function () {

src/modal/test/modal.spec.js

+16
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,22 @@ describe('$modal', function () {
375375
expect($document).toHaveModalOpenWithContent('Static backdrop', 'div');
376376
expect($document).toHaveBackdrop();
377377
});
378+
379+
it('should animate backdrop on each modal opening', function () {
380+
381+
var modal = open({ template: '<div>With backdrop</div>' });
382+
var backdropEl = $document.find('body > div.modal-backdrop');
383+
expect(backdropEl).not.toHaveClass('in');
384+
385+
$timeout.flush();
386+
expect(backdropEl).toHaveClass('in');
387+
388+
dismiss(modal);
389+
modal = open({ template: '<div>With backdrop</div>' });
390+
backdropEl = $document.find('body > div.modal-backdrop');
391+
expect(backdropEl).not.toHaveClass('in');
392+
393+
});
378394
});
379395

380396
describe('custom window classes', function () {

0 commit comments

Comments
 (0)