Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/workarea-commerce/workarea-filter-dropdowns
https://github.com/workarea-commerce/workarea-filter-dropdowns
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/workarea-commerce/workarea-filter-dropdowns
- Owner: workarea-commerce
- License: other
- Created: 2019-11-13T19:25:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-03T16:46:20.000Z (about 5 years ago)
- Last Synced: 2024-10-31T13:39:51.504Z (2 months ago)
- Language: Ruby
- Size: 37.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Workarea Filter Dropdowns
================================================================================Filter Dropdowns plugin for the Workarea Commerce platform.
Using Workarea Filter Dropdowns
--------------------------------------------------------------------------------This gem packages up the [workarea-accordions](https://stash.tools.workarea.com/projects/WP/repos/workarea-accordions/browse) gem and includes a JS config preset to utilize jQuery UI's accordion functionality to the browse filters into dropdown menus. Other elements may be converted into dropdowns by applying the same accordion preset data attribute value, but they will have to match the relavent markup from the browse filters. Or the config will need to be customized. See [https://jqueryui.com/accordion/](https://jqueryui.com/accordion/) for jQuery UI Accordion documentation.
Simply add a data attribute to `.result-filters` element like this:
`.result-filters{ data: { accordion: { presetConfig: 'filtersAccordionOptions' }.to_json } }`
Along with the `filtersAccordionOptions` preset configuration, there is a `filtersAccordionOptionsActive` config that will default the dropdown to open. This version of the gem also includes a helper method, `contains_selected_filter?` to help you conditionally apply the appropriate preset configuration based on the presence of any selected filters.
`.result-filters{ data: { accordion: { presetConfig: contains_selected_filter?(name) ? 'filtersAccordionOptionsActive' : 'filtersAccordionOptions' }.to_json } }`
Workarea Platform Documentation
--------------------------------------------------------------------------------See [https://developer.workarea.com](https://developer.workarea.com) for Workarea platform documentation.
Copyright & Licensing
--------------------------------------------------------------------------------
Workarea Commerce Platform is released under the [Business Software License](https://github.com/workarea-commerce/workarea/blob/master/LICENSE)