animator-css
animator-css copied to clipboard
Add toggleClass() to the animation abstraction
I'm submitting a feature request
- Library Version: 1.0.1
Please tell us about your environment:
-
Operating System: OSX 10.x
-
Node Version: 7.3.0
- NPM Version: 3.10.10
- JSPM OR Webpack AND Version JSPM 0.16.53
-
Browser: all
-
Language: ESNext
Current behavior:
Presently, the animation abstraction offers up addClass() and removeClass(). This leads to code like this:
if (reveal) {
this.animator.addClass(...);
else {
this.animator.removeClass(...);
}
Not the end of the world, but a little verbose.
Expected/desired behavior:
I would suggest a toggleClass() method on the abstraction. It is certainly in keeping with many of the animation libraries out there, including jQuery's, and it would allow the above to be reduced to:
this.animator.toggleClass(...);
- What is the motivation / use case for changing the behavior? Terseness, clarity, and harmony with many animation libraries' conventional approach.