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

Unified Diff: pkg/observe/lib/html.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/observe/lib/observe.dart » ('j') | pkg/observe/lib/observe.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/lib/html.dart
diff --git a/pkg/observe/lib/html.dart b/pkg/observe/lib/html.dart
index abf333a4abba170f7954274825eb694ad1248c06..262753149136e9314ae94cb8ff9f9ddcf6f6994a 100644
--- a/pkg/observe/lib/html.dart
+++ b/pkg/observe/lib/html.dart
@@ -51,7 +51,12 @@ class ObservableLocationHash extends ChangeNotifier {
}
}
-/** Add or remove CSS class [className] based on the [value]. */
+/**
+ * *Deprecated* use [CssClassSet.toggle] instead.
+ *
+ * Add or remove CSS class [className] based on the [value].
+ */
+@deprecated
void updateCssClass(Element element, String className, bool value) {
if (value == true) {
element.classes.add(className);
@@ -60,11 +65,21 @@ void updateCssClass(Element element, String className, bool value) {
}
}
-/** Bind a CSS class to the observable [object] and property [path]. */
+/**
+ * *Deprecated* use `class="{{ binding }}"` in your HTML instead. It will also
+ * work on a `<polymer-element>`.
+ *
+ * Bind a CSS class to the observable [object] and property [path].
+ */
+@deprecated
PathObserver bindCssClass(Element element, String className,
Observable object, String path) {
- return new PathObserver(object, path)..bindSync((value) {
+ callback(value) {
updateCssClass(element, className, value);
- });
+ }
+
+ var obs = new PathObserver(object, path);
+ callback(obs.open(callback));
+ return obs;
}
« no previous file with comments | « no previous file | pkg/observe/lib/observe.dart » ('j') | pkg/observe/lib/observe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698