Releases: Twikito/easy-toggle-state
Update Babel to version 7
v1.8.2 1.8.2
New feature: Custom prefix
You can change the prefix toggle
in data-toggle-class
and every attributes to prevent conflict with another JS library. To do so, add this attribute to your <html>
element with your new prefix:
<html data-easy-toggle-state-custom-prefix="my-prefix">
It will so be set to all attributes like data-my-prefix-class
.
Hooks!
You can npw add some hooks: each trigger and target element fires a toggleBefore
event before and a toggleAfter
event after toggling its state, so you can add event listeners on these events, and test the active state with isToggleActive
property. For example:
document.querySelector("#myTrigger").addEventListener("toggleAfter", (event) => {
console.log(`Active: ${event.target.isToggleActive}`);
}, false);
Documentation revamp
Documentation update for better readability.
Readme update
Compatibility explanation update.
Polyfills now with polyfill.io
In addition of using ES5 version, now compatibility for Internet Explorer is provided by polyfill.io which supports back to IE 7. It brings polyfills for Array.from
and Element.prototype.closest
.
And before you ask, yes, you can run it locally.
Escape key management fix
v1.6.2 1.6.2
Performance update
v1.6.1 1.6.1
New feature: radio group
data-toggle-radio-group="groupName"
Specify if a trigger is a part of a radio group. Only one trigger of a radio group can be active at a time.
Unlike a simple group data-toggle-group
, as soon as a trigger is activated, a radio group will always keep one trigger active. It will actually behave like radio buttons or tabs component.
Update dependencies
- Update dependencies
- New "open in CodePen" feature in doc