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

Commit

Permalink
fix(modal): properly animate backdrops on each modal opening
Browse files Browse the repository at this point in the history
Closes #1267
  • Loading branch information
plainkeyman authored and pkozlowski-opensource committed Dec 21, 2013
1 parent d168589 commit 672a557
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ angular.module('ui.bootstrap.modal', [])
restrict: 'EA',
replace: true,
templateUrl: 'template/modal/backdrop.html',
link: function (scope, element, attrs) {
link: function (scope) {

scope.animate = false;

//trigger CSS transitions
$timeout(function () {
Expand Down
16 changes: 16 additions & 0 deletions src/modal/test/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,22 @@ describe('$modal', function () {
expect($document).toHaveModalOpenWithContent('Static backdrop', 'div');
expect($document).toHaveBackdrop();
});

it('should animate backdrop on each modal opening', function () {

var modal = open({ template: '<div>With backdrop</div>' });
var backdropEl = $document.find('body > div.modal-backdrop');
expect(backdropEl).not.toHaveClass('in');

$timeout.flush();
expect(backdropEl).toHaveClass('in');

dismiss(modal);
modal = open({ template: '<div>With backdrop</div>' });
backdropEl = $document.find('body > div.modal-backdrop');
expect(backdropEl).not.toHaveClass('in');

});
});

describe('custom window classes', function () {
Expand Down

0 comments on commit 672a557

Please sign in to comment.