]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
test: add visual test for Reveal "closeOnClick" option
authorNicolas Coden <nicolas@ncoden.fr>
Wed, 1 Aug 2018 21:31:04 +0000 (23:31 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Wed, 1 Aug 2018 21:31:04 +0000 (23:31 +0200)
test/visual/reveal/close-on-click.html [new file with mode: 0644]

diff --git a/test/visual/reveal/close-on-click.html b/test/visual/reveal/close-on-click.html
new file mode 100644 (file)
index 0000000..05b3cd7
--- /dev/null
@@ -0,0 +1,49 @@
+<!doctype html>
+<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
+<html class="no-js" lang="en" dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+    <title>Foundation for Sites Testing</title>
+    <link href="../motion-ui/dist/motion-ui.css" rel="stylesheet" />
+    <link href="../assets/css/foundation.css" rel="stylesheet" />
+  </head>
+  <body>
+
+    <div class="grid-container">
+      <div class="grid-x grid-padding-x">
+        <div class="cell">
+
+          <h1>Reveal: closeOnClick option</h1>
+
+          <p>This modal should not close when clicking/taping outside of it.</p>
+          <p><button class="button" data-open="exampleModal1">Open modal</button></p>
+
+          <div class="reveal" id="exampleModal1" data-reveal data-close-on-click="false">
+            <p>Clicking/taping outside of me SHOULD NOT close me.</p>
+            <p><button class="button" data-close="exampleModal1">Close</button></p>
+          </div>
+
+          <hr>
+
+          <p>This modal should close when clicking (desktop) or taping without swiping (mobile) outside of it.</p>
+          <p><button class="button" data-open="exampleModal2">Open modal</button></p>
+
+          <div class="reveal" id="exampleModal2" data-reveal data-close-on-click="true">
+            <p>Clicking (desktop) or taping without swiping (mobile) outside of me SHOULD close me.</p>
+            <p><button class="button" data-close="exampleModal2">Close</button></p>
+          </div>
+
+        </div>
+      </div>
+    </div>
+
+    <script src="../assets/js/vendor.js"></script>
+    <script src="../assets/js/foundation.js"></script>
+    <script>
+      $(document).foundation();
+    </script>
+
+  </body>
+</html>