You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often one has a dynamic bool which specifies whether an element should have a given class. For example, a widget's isActive property could map to an 'active' css class. This use case could be supported by adding an optional argument to CssClassSet.toggle as follows:
This issue was originally filed by @seaneagan
Often one has a dynamic bool which specifies whether an element should have a given class. For example, a widget's isActive property could map to an 'active' css class. This use case could be supported by adding an optional argument to CssClassSet.toggle as follows:
void toggle(String clazz, [bool contain]) {
if(contain == null) contain = !contains(clazz);
contain ? (add : remove)(clazz);
}
I suppose it should probably be added to toggleAll as well, or maybe just remove toggleAll, since one can do:
classes.forEach(el.toggle);
or:
classes.forEach((clazz) => el.toggle(clazz, contain);
The text was updated successfully, but these errors were encountered: