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

Commit

Permalink
Overlay close conditional logic. Fixes #199
Browse files Browse the repository at this point in the history
  • Loading branch information
AntJanus committed Dec 4, 2014
1 parent 290b384 commit b27f679
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h4>Stay Updated</h4>
</div>
<!-- /App frame -->

<div zf-modal size="small" id="mainModal" overlay="true">
<div zf-modal size="small" id="mainModal" overlay="true" overlay-close="true">
<div class="grid-block vertical">
<div class="primary title-bar">
<div class="center title">Title Bar</div>
Expand Down
12 changes: 9 additions & 3 deletions js/angular/directives/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ angular.module('foundation.modal')
var dialog = angular.element(element.children()[0]);

scope.active = false;
scope.overlay = scope.overlay || scope.overlayClose || false;
scope.overlayClose = scope.overlayClose || false;
scope.overlay = scope.overlay === 'true' || scope.overlayClose === 'true' ? true : false;
scope.overlayClose = scope.overlayClose === 'true' ? true : false;

var animationIn = attrs.animationIn || 'fadeIn';
var animationOut = attrs.animationOut || 'fadeOut';
Expand Down Expand Up @@ -53,7 +53,13 @@ angular.module('foundation.modal')
} else {
foundationApi.animate(element, scope.active, overlayIn, overlayOut);
}
}
};

scope.hideOverlay = function() {
if(scope.overlayClose === 'true') {
scope.hide();
}
};

scope.hide = function() {
scope.active = false;
Expand Down

0 comments on commit b27f679

Please sign in to comment.