]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
updates docs for dropdowns
authorChris Oyler <chris@zurb.com>
Tue, 2 Feb 2016 01:09:15 +0000 (17:09 -0800)
committerChris Oyler <chris@zurb.com>
Tue, 2 Feb 2016 01:09:15 +0000 (17:09 -0800)
docs/pages/dropdown.md
js/foundation.dropdown.js

index 73a7ec88e3cd8170ab3f5f7c76a81abfff837fb8..6c93a64c801097da02b6cef396c76228a1123170 100644 (file)
@@ -37,7 +37,7 @@ To create the dropdown trigger, add `data-toggle` to a `<button>`. The value of
 
 
 <button class="button" type="button" data-toggle="example-dropdown-1">Hoverable Dropdown</button>
-<div class="dropdown-pane" id="example-dropdown-1" data-dropdown data-hover="true">
+<div class="dropdown-pane" id="example-dropdown-1" data-dropdown data-hover="true" data-hover-pane="true">
   Just some junk that needs to be said. Or not. Your choice.
 </div>
 ```
index b87c8cc432c2e7fbc3e6384218ddf20b91d0c3af..22e388cf8681feeec1fc0f757ea2b9b892730c27 100644 (file)
@@ -31,7 +31,7 @@
 
   Dropdown.defaults = {
     /**
-     * Amount of time to delay opening a submenu on hover event.
+     * Amount of time, in milliseconds to delay opening a submenu on hover event.
      * @option
      * @example 250
      */
      */
     hover: false,
     /**
-     * Don't close dropdown when hovering over dropdown pane
+     * Prevent the dropdown pane from closing while hovering over it
      * @option
-     * @example true
+     * @example false
      */
     hoverPane: false,
     /**
-     * Number of pixels between the dropdown pane and the triggering element on open.
+     * Number of pixels between the dropdown pane and the triggering element on open, on the Y-axis
      * @option
      * @example 1
      */
     vOffset: 1,
     /**
-     * Number of pixels between the dropdown pane and the triggering element on open.
+     * Number of pixels between the dropdown pane and the triggering element on open, on the X-axis.
      * @option
      * @example 1
      */
      */
     positionClass: '',
     /**
-     * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.
+     * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. Useful if your dropdown pane contains form elements.
      * @option
      * @example false
      */
     trapFocus: false,
     /**
-     * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.
+     * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. Will cause the page to scroll your dropdown pane into view if opening via JS.
      * @option
      * @example true
      */
       'data-yeti-box': $id,
       'aria-haspopup': true,
       'aria-expanded': false
-      // 'data-resize': $id
+
     });
 
     this.options.positionClass = this.getPositionClass();
      * @event Dropdown#show
      */
      this.$element.trigger('show.zf.dropdown', [this.$element]);
-    //why does this not work correctly for this plugin?
-    // Foundation.reflow(this.$element, 'dropdown');
-    // Foundation._reflow(this.$element.attr('data-dropdown'));
   };
 
   /**
       this.usedPositions.length = 0;
     }
     this.$element.trigger('hide.zf.dropdown', [this.$element]);
-    // Foundation.reflow(this.$element, 'dropdown');
   };
   /**
    * Toggles the dropdown pane's visibility.