Panel and modal close bindings should refer the target element in the event, not $(this)

This commit is contained in:
Fabio Manganiello 2019-02-21 20:13:31 +01:00
parent 749436c452
commit 73383ab80f
1 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ $(document).ready(function() {
});
$('body').on('mouseup touchend', function(event) {
var $source = $(this);
var $source = $(event.target);
if (!$source.parents('.modal').length
&& !$source.data('modal')
&& !$source.data('dismiss-modal')) {
@ -196,7 +196,7 @@ $(document).ready(function() {
var initPanelCloseBindings = function() {
$('body').on('mouseup touchend', function(event) {
var $source = $(this);
var $source = $(event.target);
if ($source.data('panel') || $source.parents('[data-panel]').length) {
var $panel = $source.data('panel') ? $($source.data('panel')) :
$($source.parents('[data-panel]').data('panel'));