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

Unified Diff: tools/dom/src/TemplateBindings.dart

Issue 14812016: expose MDV addBindings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « tests/html/template_element_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/TemplateBindings.dart
diff --git a/tools/dom/src/TemplateBindings.dart b/tools/dom/src/TemplateBindings.dart
index 6e064efee4926cac111cf842d35de7e08efe4a08..9841aeebb422479f8f747c2f1020365f24d9b8bf 100644
--- a/tools/dom/src/TemplateBindings.dart
+++ b/tools/dom/src/TemplateBindings.dart
@@ -5,7 +5,7 @@
part of html;
// This code is a port of Model-Driven-Views:
-// https://github.com/toolkitchen/mdv
+// https://github.com/polymer-project/mdv
// The code mostly comes from src/template_element.js
typedef void _ChangeHandler(value);
@@ -37,7 +37,7 @@ typedef void _ChangeHandler(value);
*
* TemplateElement.syntax['MySyntax'] = new MySyntax();
*
- * See <https://github.com/toolkitchen/mdv/blob/master/docs/syntax.md> for more
+ * See <https://github.com/polymer-project/mdv/blob/master/docs/syntax.md> for more
* information about Custom Syntax.
*/
// TODO(jmesserly): if this is just one method, a function type would make it
@@ -359,7 +359,7 @@ class _Bindings {
// apply for template data-binding. HTML attributes are true if they're
// present. However Dart only treats "true" as true. Since this is HTML we'll
// use something closer to the HTML rules: null (missing) and false are false,
- // everything else is true. See: https://github.com/toolkitchen/mdv/issues/59
+ // everything else is true. See: https://github.com/polymer-project/mdv/issues/59
static bool _toBoolean(value) => null != value && false != value;
static Node _createDeepCloneAndDecorateTemplates(Node node, String syntax) {
@@ -493,6 +493,9 @@ class _Bindings {
return;
}
+ // If this is a custom element, give the .xtag a change to bind.
+ node = _nodeOrCustom(node);
+
if (tokens.length == 1 && tokens[0].isBinding) {
_bindOrDelegate(node, name, model, tokens[0].value, syntax);
return;
@@ -524,7 +527,7 @@ class _Bindings {
return newValue.toString();
};
- _nodeOrCustom(node).bind(name, replacementBinding, 'value');
+ node.bind(name, replacementBinding, 'value');
}
static void _bindOrDelegate(node, name, model, String path,
@@ -538,7 +541,7 @@ class _Bindings {
}
}
- _nodeOrCustom(node).bind(name, model, path);
+ node.bind(name, model, path);
}
/**
« no previous file with comments | « tests/html/template_element_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698