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

Commit

Permalink
fix(modal): opening a modal should not change default options
Browse files Browse the repository at this point in the history
Closes #935
  • Loading branch information
pkozlowski-opensource committed Sep 3, 2013
1 parent dd99f35 commit 82532d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ angular.module('ui.bootstrap.modal', [])
};

//merge and clean up options
modalOptions = angular.extend(defaultOptions, modalOptions);
modalOptions = angular.extend({}, defaultOptions, modalOptions);
modalOptions.resolve = modalOptions.resolve || {};

//verify options
Expand Down
9 changes: 9 additions & 0 deletions src/modal/test/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,14 @@ describe('$modal', function () {

expect($document).toHaveModalsOpen(2);
});

it('multiple modals should not interfere with default options', function () {

var modal1 = open({template: '<div>Modal1</div>', backdrop: false});
var modal2 = open({template: '<div>Modal2</div>'});
$rootScope.$digest();

expect($document).toHaveBackdrop();
});
});
});

0 comments on commit 82532d1

Please sign in to comment.