]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Prevent dropdown panes taller than the window from resizing to be full-width, fixes...
authorGeoff Kimball <geoff@zurb.com>
Tue, 8 Mar 2016 18:14:00 +0000 (10:14 -0800)
committerGeoff Kimball <geoff@zurb.com>
Wed, 16 Mar 2016 16:42:36 +0000 (09:42 -0700)
js/foundation.dropdown.js
test/visual/dropdown/long.html [new file with mode: 0644]

index 3f585138fb0261adffa9b2f4c108056e9413ac75..07d7c4556ebb5c8ed320ef8432ad47969385a9d7 100644 (file)
@@ -141,7 +141,7 @@ class Dropdown {
 
     this.$element.offset(Foundation.Box.GetOffsets(this.$element, this.$anchor, position, this.options.vOffset, this.options.hOffset));
 
-    while(!Foundation.Box.ImNotTouchingYou(this.$element) && this.counter){
+    while(!Foundation.Box.ImNotTouchingYou(this.$element, false, true) && this.counter){
       this._reposition(position);
       this._setPosition();
     }
diff --git a/test/visual/dropdown/long.html b/test/visual/dropdown/long.html
new file mode 100644 (file)
index 0000000..458b218
--- /dev/null
@@ -0,0 +1,51 @@
+<!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">
+    <title>Foundation for Sites Testing</title>
+    <link href="../assets/css/foundation.css" rel="stylesheet" />
+  </head>
+  <body>
+    <div class="row column">
+      <h1>Dropdown: Long Content</h1>
+
+      <p>This dropdown should not go full-width, even if its contents are higher than the width of the window.</p>
+
+      <button class="button" type="button" data-toggle="example-dropdown">Toggle Dropdown</button>
+      <div class="dropdown-pane" id="example-dropdown" data-dropdown data-auto-focus="true">
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+        <p>This is a dropdown.</p>
+      </div>
+    </div>
+
+    <script src="../assets/js/vendor.js"></script>
+    <script src="../assets/js/foundation.js"></script>
+    <script>
+      $(document).foundation();
+    </script>
+  </body>
+</html>