]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Stop propagation of click events on the background 4444/head
authorgaborluk <gabor.luk@gmail.com>
Fri, 14 Feb 2014 16:30:19 +0000 (17:30 +0100)
committergaborluk <gabor.luk@gmail.com>
Fri, 14 Feb 2014 16:30:19 +0000 (17:30 +0100)
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

index 659bec4fa95d42f918337afcc454d288323b4d4d..c2c923a2bfaa0bbe08f5108d6a47317f9dacff63 100644 (file)
             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;