Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/modal/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,15 @@ 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('<div modal-backdrop></div>')(backdropScope);
body.append(backdropDomEl);
}

// Create a faux modal div just to measure its
// distance to top
var faux = angular.element('<div class="reveal-modal" style="z-index:-1""></div>');
var faux = angular.element('<div class="reveal-modal" style="z-index:-1"></div>');
body.append(faux[0]);
var marginTop = parseInt(getComputedStyle(faux[0]).top) || 0;
faux.remove();
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion template/modal/backdrop.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="reveal-modal-bg fade" ng-class="{in: animate}" ng-click="close($event)" style="display: block"></div>
<div class="reveal-modal-bg fade {{ backdropClass }}" ng-class="{in: animate}" ng-click="close($event)" style="display: block"></div>