Skip to content

Releases: Twikito/easy-toggle-state

Update Babel to version 7

06 Sep 22:14
Compare
Choose a tag to compare

New feature: Custom prefix

18 Aug 14:14
Compare
Choose a tag to compare

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!

14 Jul 14:55
Compare
Choose a tag to compare

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

05 Jul 16:45
Compare
Choose a tag to compare

Documentation update for better readability.

Readme update

29 Jun 16:56
Compare
Choose a tag to compare

Compatibility explanation update.

Polyfills now with polyfill.io

29 Jun 16:36
Compare
Choose a tag to compare

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

27 Jun 22:02
Compare
Choose a tag to compare

Performance update

27 Jun 07:35
Compare
Choose a tag to compare
v1.6.1

1.6.1

New feature: radio group

20 Jun 12:16
Compare
Choose a tag to compare
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

13 Jun 20:43
Compare
Choose a tag to compare
  • Update dependencies
  • New "open in CodePen" feature in doc