diff --git a/README.md b/README.md index 14d371d..547b06d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ You can also use a separate template for the dropdown and dropdown trigger conte Note that `dropdownTrigger` needs the template name in the `template` argument. -### Additional arguments +### Dropdown arguments The `dropdown` helper takes additional arguments for positioning and custom classes. The names are: @@ -92,6 +92,22 @@ The `dropdown` helper takes additional arguments for positioning and custom clas {{/dropdown}} ``` +### Trigger arguments + +The `dropdownTrigger` helper takes additional arguments for change trigger event. The names are: +- `on` - Defaults to `click`. Set to `hover` for respond to the pointing of the mouse. Set `none` for disable trigger logic. You can use `usePosition` for write your own reactions logic. +- `timeout` - Defaults is `0`. Set a number to have time to move the mouse from the `dropdownTrigger` on the `dropdown`. +- +```html +{{#dropdownTrigger name="testDropdown4" on="hover" timeout=500}} + +{{/dropdownTrigger}} + +{{#dropdown name="testDropdown4" top="-10" direction="n"}} +

Custom dropdown.

+{{/dropdown}} +``` + ### Markup & Classes The `dropdownTrigger` template helper doesn't produce any extra HTML around your content. `dropdown` on the other hand produces the following HTML: @@ -105,7 +121,7 @@ The `dropdownTrigger` template helper doesn't produce any extra HTML around your -{{#dropdown name="testDropdown4" align="center" top="20" left="10" classes="custom-class"}} +{{#dropdown name="testDropdown5" align="center" top="20" left="10" classes="custom-class"}} {{/dropdown}} @@ -115,7 +131,7 @@ The `dropdownTrigger` template helper doesn't produce any extra HTML around your class="dropdown test-dropdown4 custom-class" id="test-dropdown4" style="position: absolute; left: XXpx; top: XXpx;" - data-dropdown-key="testDropdown4" + data-dropdown-key="testDropdown5" data-dropdown-align="center" data-dropdown-left="10" data-dropdown-top="20"> @@ -137,8 +153,8 @@ Please note that the `name` template argument will be present as `id` and `class In order to detect active, opened dropdowns, the global `dropdownIsActive` helper can be used: ``` -{{#dropdownTrigger name="testDropdown5"}} - +{{#dropdownTrigger name="testDropdown6"}} + {{/dropdownTrigger}} ``` @@ -155,11 +171,11 @@ Template.testTemplate.helpers( ```html