diff --git a/src/js/core.js b/src/js/core.js index 7cdfd6f0..36a24ec7 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -707,7 +707,7 @@ MagnificPopup.prototype = { } else { // We close the popup if click is on close button or on preloader. Or if there is no content. - if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { + if(!mfp.content || $(target).closest('.mfp-close').length || (mfp.preloader && target === mfp.preloader[0]) ) { return true; } @@ -936,4 +936,4 @@ $.fn.magnificPopup = function(options) { } return jqEl; -}; \ No newline at end of file +};