A collection of useful custom jQuery widgets for Magento 2.
This widget allows to filter listing of article or pushs by categories.
- Add a data-filter="all" to the button that needed to display all categories
- Add a data-role="filter" on every links that is going to filter listing by categories
- Add a data-role="filters" on filter links listing
- Add a data-role="category" on every listing item that you would like to filter
- Add a data-lazy="path" on every images that need to be lazy loaded in categories
This widget allows to custom input file element.
<div data-mage-init='{ "<categoryFilter>": {...} }'></div>
- input : String (example : '[data-role=input-file]')
- button : String (example : '[data-role=input-file-trigger]')
- message : String (example : '[data-role=input-file-message]')
This widget transform list elements to select elements (useful for mobile resolution).
<div data-mage-init='{ "<listToSelect>": {...} }'></div>
- mobileOnly : Boolean
- mobileBreakPoint : Number
This widget allows user to show its password during form completing.
<input typ="password" />
<div class="check-password" data-mage-init='{ "<listToSelect>": {...} }'></div>
- actionType : String (onClick, onRelease)
- mobileBreakPoint : Number
This widget allows user to check if its password is strong enough.
<input type="password" data-mage-init='{ "<passwordStrength>": {...} }'></div>
This widget allows to add animated scroll to target element on link click.
- Your target ID must correspond to the href value of your link element
- Your links must have a ul li parent structure
<div data-mage-init='{ "<scrollTo>": {...} }'></div>
- linksElement: String (example : '[data-role=links]'),
- animateDuration: Number
- stickyHeader: Boolean
Add sticky to Magento main header.
<div data-mage-init='{ "<stickyHeader>": {...} }'></div>