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

Unified Diff: pkg/mdv/lib/src/text_area_element.dart

Issue 20149004: [mdv] implement Node.createBinding and Node.createBindings (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:
View side-by-side diff with in-line comments
Download patch
Index: pkg/mdv/lib/src/text_area_element.dart
diff --git a/pkg/mdv/lib/src/text_area_element.dart b/pkg/mdv/lib/src/text_area_element.dart
index d8096914fc3d2bc781812d9187911cbe11f2b168..200cd7416f2336738d58ae152b32b5ce0872a08b 100644
--- a/pkg/mdv/lib/src/text_area_element.dart
+++ b/pkg/mdv/lib/src/text_area_element.dart
@@ -6,29 +6,16 @@ part of mdv;
/** Extensions to the [TextAreaElement] API. */
class _TextAreaElementExtension extends _ElementExtension {
- _ValueBinding _valueBinding;
-
_TextAreaElementExtension(TextAreaElement node) : super(node);
TextAreaElement get node => super.node;
- void bind(String name, model, String path) {
- if (name.toLowerCase() == 'value') {
- unbind('value');
- node.attributes.remove('value');
- _valueBinding = new _ValueBinding(node, model, path);
- }
- }
-
- void unbind(String name) {
- if (name.toLowerCase() == 'value' && _valueBinding != null) {
- _valueBinding.unbind();
- _valueBinding = null;
+ NodeBinding createBinding(String name, model, String path) {
+ if (name == 'value') {
+ // TODO(rafaelw): Maybe template should remove all binding instructions.
+ node.attributes.remove(name);
+ return new _ValueBinding(node, model, path);
}
- }
-
- void unbindAll() {
- unbind('value');
- super.unbindAll();
+ return super.createBinding(name, model, path);
}
}

Powered by Google App Engine
This is Rietveld 408576698