Skip to content

Commit

Permalink
Merge pull request #21 from base-apps/fix-modal-overlay-events
Browse files Browse the repository at this point in the history
resolves #20
  • Loading branch information
soumak77 committed Jul 19, 2016
2 parents 3df326e + d186040 commit e5091a7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
class: 'tiny dialog',
overlay: true,
overlayClose: false,
templateUrl: 'partials/examples-dynamic-modal.html',
templateUrl: 'partials/examples-dynamic-modal2.html',
contentScope: {
close: function() {
modal.deactivate();
Expand Down
8 changes: 8 additions & 0 deletions docs/partials/examples-dynamic-modal2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="grid-block vertical text-center">
<div class="grid-content">
<strong>This modal was created programmatically using an <a href="https://docs.angularjs.org/guide/providers" target="_blank">Angular Factory</a></strong>
<br/>
<br/>
<a class="button" ng-click="close()">Close</a>
</div>
</div>
2 changes: 1 addition & 1 deletion docs/templates/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h3>Angular-ize Your Modals</h3>
'class': 'tiny dialog',
'overlay': true,
'overlayClose': false,
'templateUrl': 'partials/examples-dynamic-modal.html',
'templateUrl': 'partials/examples-dynamic-modal2.html',
'contentScope': {
'close': function() {
modal.deactivate();
Expand Down
3 changes: 1 addition & 2 deletions js/angular/components/modal/modal.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div
class="modal-overlay"
ng-click="hideOverlay()">
ng-click="hideOverlay($event)">
<aside
class="modal"
ng-click="$event.stopPropagation();"
ng-transclude>
</aside>
</div>
4 changes: 2 additions & 2 deletions js/angular/components/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
var overlayIn = 'fadeIn';
var overlayOut = 'fadeOut';

scope.hideOverlay = function() {
if(scope.overlayClose) {
scope.hideOverlay = function($event) {
if($event.target.id == attrs.id && scope.overlayClose) {
foundationApi.publish(attrs.id, 'close');
}
};
Expand Down

0 comments on commit e5091a7

Please sign in to comment.