From 6dc2e3ec4d9aba9ddc3a9ecefeb6d0106570492d Mon Sep 17 00:00:00 2001 From: gaborluk Date: Fri, 14 Feb 2014 17:30:19 +0100 Subject: [PATCH] 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). --- js/foundation/foundation.reveal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.47.2