From 9a129957767facae0201682721a3ad2459ce96ab Mon Sep 17 00:00:00 2001 From: Marius Olbertz Date: Thu, 5 May 2016 18:37:59 +0200 Subject: [PATCH] Adjusted check if the Reveal was closed or another closable within. Also added visual test. --- js/foundation.reveal.js | 4 +-- test/visual/reveal/reveal-callout.html | 44 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 test/visual/reveal/reveal-callout.html 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

+
+ +
+ + + + + + -- 2.47.2