Skip to content

Commit

Permalink
Moved click event from template to directive code
Browse files Browse the repository at this point in the history
  • Loading branch information
jiniguez committed Dec 2, 2014
1 parent eec68d8 commit 722036c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
element.addClass(attrs.windowClass || '');
scope.size = attrs.size;

// moved from template to fix issue #2280
element.on('click', function(evt) {
scope.close(evt);
});

$timeout(function () {
// trigger CSS transitions
scope.animate = true;
Expand Down
2 changes: 1 addition & 1 deletion template/modal/window.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" ng-click="close($event)">
<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}">
<div class="modal-dialog" ng-class="{'modal-sm': size == 'sm', 'modal-lg': size == 'lg'}"><div class="modal-content" modal-transclude></div></div>
</div>

0 comments on commit 722036c

Please sign in to comment.