From 3d97b9704fdf76cbfd9359bc755e515cd33847e5 Mon Sep 17 00:00:00 2001 From: sktocha Date: Sun, 13 Aug 2017 22:06:37 +0300 Subject: [PATCH] pass event to disableOn handler --- dist/jquery.magnific-popup.js | 4 ++-- src/js/core.js | 4 ++-- website/documentation.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/jquery.magnific-popup.js b/dist/jquery.magnific-popup.js index 927b3c1f..390cfe41 100644 --- a/dist/jquery.magnific-popup.js +++ b/dist/jquery.magnific-popup.js @@ -642,7 +642,7 @@ MagnificPopup.prototype = { if(disableOn) { if($.isFunction(disableOn)) { - if( !disableOn.call(mfp) ) { + if( !disableOn.call(mfp, e) ) { return true; } } else { // else it's number @@ -1857,4 +1857,4 @@ $.magnificPopup.registerModule(RETINA_NS, { }); /*>>retina*/ - _checkInstance(); })); \ No newline at end of file + _checkInstance(); })); diff --git a/src/js/core.js b/src/js/core.js index aaa18e7f..bcdbd0ed 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -625,7 +625,7 @@ MagnificPopup.prototype = { if(disableOn) { if($.isFunction(disableOn)) { - if( !disableOn.call(mfp) ) { + if( !disableOn.call(mfp, e) ) { return true; } } else { // else it's number @@ -936,4 +936,4 @@ $.fn.magnificPopup = function(options) { } return jqEl; -}; \ No newline at end of file +}; diff --git a/website/documentation.md b/website/documentation.md index eecff3a2..a5064732 100644 --- a/website/documentation.md +++ b/website/documentation.md @@ -468,7 +468,7 @@ If window width is less than the number in this option lightbox will not be open Can also accept Function as a parameter, which should return `true` if lightbox can be opened and `false` otherwise. For example: {% highlight javascript %} -disableOn: function() { +disableOn: function(e) { if( $(window).width() < 600 ) { return false; }