From: Marius Olbertz Date: Thu, 5 May 2016 16:37:59 +0000 (+0200) Subject: Adjusted check if the Reveal was closed or another closable within. X-Git-Tag: v6.2.2-rc1~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8471%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Adjusted check if the Reveal was closed or another closable within. Also added visual test. --- diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index 938ea9040..8199e4b9f 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -133,8 +133,8 @@ class Reveal { this.$element.on({ 'open.zf.trigger': this.open.bind(this), - 'close.zf.trigger': (event, element) => { - if (typeof element === 'undefined') { // only close reveal when it's explicitly called + 'close.zf.trigger': (event, $element) => { + if ($(event.target).parents('[data-closable]')[0] === $element) { // only close reveal when it's explicitly called return this.close.apply(this); } }, diff --git a/test/visual/reveal/reveal-callout.html b/test/visual/reveal/reveal-callout.html new file mode 100644 index 000000000..c6bba947d --- /dev/null +++ b/test/visual/reveal/reveal-callout.html @@ -0,0 +1,44 @@ + + + + + + + Foundation for Sites Testing + + + +
+

Reveal

+ +
+

Callout inside Reveal

+

Test if a callout inside a Reveal can be closed without closing the Reveal aswell.

+
+

Closeable callout in reveal bug

+

When you close the callout, the reveal is closed too, which shouldn't!

+ +
+

Close me now!

+ +
+ + +
+ +

Click me for a modal

+
+ +
+ + + + + +