Skip to content

Commit

Permalink
Merge pull request #57 from ibrahima/patch-1
Browse files Browse the repository at this point in the history
Fix click events when closeOnOverlayClick is true
  • Loading branch information
samdark committed Jan 27, 2016
2 parents 426c179 + e71414d commit f9a5239
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jquery.the-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@
}

if(localOptions.closeOnOverlayClick) {
overlay.children().on('click.' + pluginNamespace, function(e){
e.stopPropagation();
});
$('.' + localOptions.overlayClass).on('click.' + pluginNamespace, function(e){
$.modal().close(localOptions);
if (e.target.className == localOptions.overlayClass){
$.modal().close();
}
});
}

Expand Down

0 comments on commit f9a5239

Please sign in to comment.