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

Side by Side Diff: pkg/template_binding/lib/src/element.dart

Issue 50203004: port TemplateBinding to ed3266266e751b5ab1f75f8e0509d0d5f0ef35d8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of template_binding; 5 part of template_binding;
6 6
7 /** Extensions to the [Element] API. */ 7 /** Extensions to the [Element] API. */
8 class _ElementExtension extends NodeBindExtension { 8 class _ElementExtension extends NodeBindExtension {
9 _ElementExtension(Element node) : super._(node); 9 _ElementExtension(Element node) : super._(node);
10 10
11 NodeBinding bind(String name, model, [String path]) { 11 NodeBinding bind(String name, model, [String path]) {
12 _self.unbind(name); 12 _self.unbind(name);
13 13
14 var binding; 14 var binding;
15 if (_node is OptionElement && name == 'value') { 15 if (_node is OptionElement && name == 'value') {
16 // Note: because <option> can be a semantic template, <option> will be 16 // Note: because <option> can be a semantic template, <option> will be
17 // a TemplateBindExtension sometimes. So we need to handle it here. 17 // a TemplateBindExtension sometimes. So we need to handle it here.
18 _node.attributes.remove(name); 18 (_node as OptionElement).attributes.remove(name);
19 binding = new _OptionValueBinding(_node, model, path); 19 binding = new _OptionValueBinding(_node, model, path);
20 } else { 20 } else {
21 binding = new _AttributeBinding(_node, name, model, path); 21 binding = new _AttributeBinding(_node, name, model, path);
22 } 22 }
23 return bindings[name] = binding; 23 return bindings[name] = binding;
24 } 24 }
25 } 25 }
26 26
27 class _AttributeBinding extends NodeBinding { 27 class _AttributeBinding extends NodeBinding {
28 final bool conditional; 28 final bool conditional;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 super.valueChanged(newValue); 76 super.valueChanged(newValue);
77 77
78 if (selectBinding != null && !selectBinding.closed && 78 if (selectBinding != null && !selectBinding.closed &&
79 select.value != oldValue) { 79 select.value != oldValue) {
80 selectBinding.nodeValueChanged(null); 80 selectBinding.nodeValueChanged(null);
81 } 81 }
82 } 82 }
83 } 83 }
OLDNEW
« no previous file with comments | « pkg/template_binding/lib/src/binding_delegate.dart ('k') | pkg/template_binding/lib/src/input_bindings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698