]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Make callouts not close the reveal they are in.
authorMarius Olbertz <marius.olbertz@gmail.com>
Sat, 19 Mar 2016 22:16:08 +0000 (23:16 +0100)
committerMarius Olbertz <marius.olbertz@gmail.com>
Sat, 19 Mar 2016 22:16:08 +0000 (23:16 +0100)
This solution is kinda sloppy, maybe there is a more elegant way to solve this...

js/foundation.reveal.js

index 046801cc867747584c8c3f2ae1dc9a0e823ca323..938ea9040db0ba52e1fdf96242b681775a61304d 100644 (file)
@@ -133,7 +133,11 @@ class Reveal {
 
     this.$element.on({
       'open.zf.trigger': this.open.bind(this),
-      'close.zf.trigger': this.close.bind(this),
+      'close.zf.trigger': (event, element) => {
+        if (typeof element === 'undefined') { // only close reveal when it's explicitly called
+          return this.close.apply(this);
+        }
+      },
       'toggle.zf.trigger': this.toggle.bind(this),
       'resizeme.zf.trigger': function() {
         _this._updatePosition();