From: gaborluk Date: Fri, 14 Feb 2014 16:30:19 +0000 (+0100) Subject: Stop propagation of click events on the background X-Git-Tag: v5.2.0~56^2~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4444%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Stop propagation of click events on the background This is to prevent the bubbled-up clicks from triggering changes behind the modal overlay (e.g., the auto-closing of open dropdowns). --- diff --git a/js/foundation/foundation.reveal.js b/js/foundation/foundation.reveal.js index 659bec4fa..c2c923a2b 100644 --- a/js/foundation/foundation.reveal.js +++ b/js/foundation/foundation.reveal.js @@ -73,8 +73,12 @@ var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init'), bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0]; - if (bg_clicked && !settings.close_on_background_click) { - return; + if (bg_clicked) { + if (settings.close_on_background_click) { + e.stopPropagation(); + } else { + return; + } } self.locked = true;