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

Commit

Permalink
feat(modal): allow global override of modal options
Browse files Browse the repository at this point in the history
  • Loading branch information
_pants authored and pkozlowski-opensource committed Feb 9, 2013
1 parent 739f86f commit acaf72b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
angular.module('ui.bootstrap.modal', []).directive('modal', ['$parse',function($parse) {
angular.module('ui.bootstrap.modal', [])
.constant('modalConfig', {
backdrop: true,
escape: true
})
.directive('modal', ['$parse', 'modalConfig', function($parse, modalConfig) {
var backdropEl;
var body = angular.element(document.getElementsByTagName('body')[0]);
var defaultOpts = {
backdrop: true,
escape: true
};
return {
restrict: 'EA',
link: function(scope, elm, attrs) {
var opts = angular.extend(defaultOpts, scope.$eval(attrs.uiOptions || attrs.bsOptions || attrs.options));
var opts = angular.extend({}, modalConfig, scope.$eval(attrs.uiOptions || attrs.bsOptions || attrs.options));
var shownExpr = attrs.modal || attrs.show;
var setClosed;

Expand Down

2 comments on commit acaf72b

@abobwhite
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently using v0.12.0 and this code is NOT there? Was this not correctly tagged?

@realityking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this was removed in ec796ec

Please sign in to comment.