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

Side by Side Diff: sky/framework/sky-element/sky-binder.sky

Issue 850383002: Add two way data binding. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Make it async. Created 5 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 unified diff | Download patch
« no previous file with comments | « sky/framework/sky-element/observe.sky ('k') | sky/framework/sky-element/sky-element.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <import src="observe.sky" as="observe" /> 6 <import src="observe.sky" as="observe" />
7 7
8 <script> 8 <script>
9 var stagingDocument = new Document(); 9 var stagingDocument = new Document();
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 })); 153 }));
154 } else if (name == 'style' || name == 'class') { 154 } else if (name == 'style' || name == 'class') {
155 updateAttribute(node, name, observable.open(function(value) { 155 updateAttribute(node, name, observable.open(function(value) {
156 updateAttribute(node, name, value); 156 updateAttribute(node, name, value);
157 })); 157 }));
158 } else { 158 } else {
159 node[name] = observable.open(function(value) { 159 node[name] = observable.open(function(value) {
160 node[name] = value; 160 node[name] = value;
161 }); 161 });
162 } 162 }
163 if (typeof node.addPropertyBinding == 'function')
164 node.addPropertyBinding(this.name, observable);
163 return observable; 165 return observable;
164 } 166 }
165 } 167 }
166 168
167 function parsePropertyDirective(value, property) { 169 function parsePropertyDirective(value, property) {
168 if (!value || !value.length) 170 if (!value || !value.length)
169 return; 171 return;
170 172
171 var result; 173 var result;
172 var offset = 0; 174 var offset = 0;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 iterators.delete(this.template); 522 iterators.delete(this.template);
521 this.closed = true; 523 this.closed = true;
522 } 524 }
523 } 525 }
524 526
525 module.exports = { 527 module.exports = {
526 createInstance: createInstance, 528 createInstance: createInstance,
527 registerElement: registerElement, 529 registerElement: registerElement,
528 }; 530 };
529 </script> 531 </script>
OLDNEW
« no previous file with comments | « sky/framework/sky-element/observe.sky ('k') | sky/framework/sky-element/sky-element.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698