From 73383ab80fa3ea6ed3899983561ff555eadc6e55 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 21 Feb 2019 20:13:31 +0100 Subject: [PATCH] Panel and modal close bindings should refer the target element in the event, not $(this) --- platypush/backend/http/static/js/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/static/js/application.js b/platypush/backend/http/static/js/application.js index 1753e06b..a89c98d6 100644 --- a/platypush/backend/http/static/js/application.js +++ b/platypush/backend/http/static/js/application.js @@ -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'));