| Index: tools/dom/src/CssClassSet.dart
|
| diff --git a/tools/dom/src/CssClassSet.dart b/tools/dom/src/CssClassSet.dart
|
| index 4ee943da14ef94c36589104946db5aa83374629e..53554462a3d2fd9fdc6d6cf96c5a8f74d4fc1d95 100644
|
| --- a/tools/dom/src/CssClassSet.dart
|
| +++ b/tools/dom/src/CssClassSet.dart
|
| @@ -10,8 +10,11 @@ abstract class CssClassSet implements Set<String> {
|
| /**
|
| * Adds the class [value] to the element if it is not on it, removes it if it
|
| * is.
|
| + *
|
| + * If [shouldAdd] is true, then we always add that [value] to the element. If
|
| + * [shouldAdd] is false then we always remove [value] from the element.
|
| */
|
| - bool toggle(String value);
|
| + bool toggle(String value, [bool shouldAdd]);
|
|
|
| /**
|
| * Returns [:true:] if classes cannot be added or removed from this
|
| @@ -66,8 +69,11 @@ abstract class CssClassSet implements Set<String> {
|
| * Iterate through [iterable]'s items, and add it if it is not on it, or
|
| * remove it if it is. This is the Dart equivalent of jQuery's
|
| * [toggleClass](http://api.jquery.com/toggleClass/).
|
| + * If [shouldAdd] is true, then we always add all the classes in [iterable]
|
| + * element. If [shouldAdd] is false then we always remove all the classes in
|
| + * [iterable] from the element.
|
| */
|
| - void toggleAll(Iterable<String> iterable);
|
| + void toggleAll(Iterable<String> iterable, [bool shouldAdd]);
|
| }
|
|
|
| /**
|
| @@ -113,8 +119,8 @@ class _MultiElementCssClassSet extends CssClassSetImpl {
|
| * Adds the class [value] to the element if it is not on it, removes it if it
|
| * is.
|
| */
|
| - bool toggle(String value) =>
|
| - _modifyWithReturnValue((e) => e.toggle(value));
|
| + bool toggle(String value, [bool shouldAdd]) =>
|
| + _modifyWithReturnValue((e) => e.toggle(value, shouldAdd));
|
|
|
| /**
|
| * Remove the class [value] from element, and return true on successful
|
|
|