Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 18583004: Added boolean to toggle. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/css_class_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 26dcd4a644867c601399fdad5d5bb06aa9246936..029f3293d6e84e17f3de4f5351fb051a072a24ca 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -28140,8 +28140,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
@@ -28196,8 +28199,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]);
}
/**
@@ -28243,8 +28249,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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/css_class_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698