Skip to content

Conversation

GottZ
Copy link

@GottZ GottZ commented Jul 6, 2019

if toggle is undefined, .toggle will act as a flip flop (wich the name "toggle" should imply)
if toggle is true, it will add the class unless it is already contained
if toggle is false, it will remove the class unless it is already removed

alternatively i'd probably suggest renaming it from toggle_class to something else. a toggle is a state aware flip flop by default.

any objections?

GottZ added 2 commits July 6, 2019 14:21
if toggle is undefined, `.toggle` will act as a flip flop (wich the name "toggle" should imply)
if toggle is true, it will add the class unless it is already contained
if toggle is false, it will remove the class unless it is already removed

alternatively i'd probably suggest renaming it from toggle_class to something else. a toggle is a state aware flip flop by default.

any objections?
@Conduitry
Copy link
Member

See #1735. Our aim is to support recent versions of IE with only transpiling required, and no polyfilling. This did actually used to be a call to .classList.toggle until #1868, which is why it has that name.

@GottZ
Copy link
Author

GottZ commented Jul 6, 2019

@Conduitry nice insight. thanks for clearification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants