diff --git a/src/modal/docs/readme.md b/src/modal/docs/readme.md index a4f721a..02e9f2e 100644 --- a/src/modal/docs/readme.md +++ b/src/modal/docs/readme.md @@ -11,6 +11,7 @@ The `$modal` service has only one method: `open(options)` where available option * `resolve` - members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes * `backdrop` - controls presence of a backdrop. Allowed values: true (default), false (no backdrop), `'static'` - backdrop is present but modal window is not closed when clicking outside of the modal window. * `keyboard` - indicates whether the dialog should be closable by hitting the ESC key, defaults to true +* `backdropClass` - additional CSS class(es) to be added to a modal backdrop template * `windowClass` - additional CSS class(es) to be added to a modal window template The `open` method returns a modal instance, an object with the following properties: diff --git a/src/modal/modal.js b/src/modal/modal.js index 902b23c..7d97d26 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -226,6 +226,7 @@ angular.module('mm.foundation.modal', ['mm.foundation.transition']) if (currBackdropIndex >= 0 && !backdropDomEl) { backdropScope = $rootScope.$new(true); + backdropScope.backdropClass = modal.backdropClass; backdropScope.index = currBackdropIndex; backdropDomEl = $compile('
')(backdropScope); body.append(backdropDomEl); @@ -233,7 +234,7 @@ angular.module('mm.foundation.modal', ['mm.foundation.transition']) // Create a faux modal div just to measure its // distance to top - var faux = angular.element(''); + var faux = angular.element(''); body.append(faux[0]); var marginTop = parseInt(getComputedStyle(faux[0]).top) || 0; faux.remove(); @@ -375,7 +376,8 @@ angular.module('mm.foundation.modal', ['mm.foundation.transition']) content: tplAndVars[0], backdrop: modalOptions.backdrop, keyboard: modalOptions.keyboard, - windowClass: modalOptions.windowClass + windowClass: modalOptions.windowClass, + backdropClass: modalOptions.backdropClass }); }, function resolveError(reason) { diff --git a/template/modal/backdrop.html b/template/modal/backdrop.html index 5e951cb..f222afd 100644 --- a/template/modal/backdrop.html +++ b/template/modal/backdrop.html @@ -1 +1 @@ - +