Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 722036c

Browse files
committed
Moved click event from template to directive code
1 parent eec68d8 commit 722036c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: src/modal/modal.js

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
9191
element.addClass(attrs.windowClass || '');
9292
scope.size = attrs.size;
9393

94+
// moved from template to fix issue #2280
95+
element.on('click', function(evt) {
96+
scope.close(evt);
97+
});
98+
9499
$timeout(function () {
95100
// trigger CSS transitions
96101
scope.animate = true;

Diff for: template/modal/window.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<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)">
1+
<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}">
22
<div class="modal-dialog" ng-class="{'modal-sm': size == 'sm', 'modal-lg': size == 'lg'}"><div class="modal-content" modal-transclude></div></div>
33
</div>

0 commit comments

Comments
 (0)