OLD | NEW |
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 <link rel="import" href="observe.sky" as="observe" /> | 6 <link rel="import" href="observe.sky" as="observe" /> |
7 | 7 |
8 <script> | 8 <script> |
9 Node.prototype.bind = function(name, observable, oneTime) { | 9 Node.prototype.bind = function(name, observable, oneTime) { |
10 var self = this; | 10 var self = this; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 function parseWithDefault(el, name, prepareBindingFn) { | 533 function parseWithDefault(el, name, prepareBindingFn) { |
534 var v = el.getAttribute(name); | 534 var v = el.getAttribute(name); |
535 return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn); | 535 return parseMustaches(v == '' ? '{{}}' : v, name, el, prepareBindingFn); |
536 } | 536 } |
537 | 537 |
538 function parseAttributeBindings(element, prepareBindingFn) { | 538 function parseAttributeBindings(element, prepareBindingFn) { |
539 var bindings = []; | 539 var bindings = []; |
540 var ifFound = false; | 540 var ifFound = false; |
541 var bindFound = false; | 541 var bindFound = false; |
| 542 var attributes = element.getAttributes(); |
542 | 543 |
543 for (var i = 0; i < element.attributes.length; i++) { | 544 for (var i = 0; i < attributes.length; i++) { |
544 var attr = element.attributes[i]; | 545 var attr = attributes[i]; |
545 var name = attr.name; | 546 var name = attr.name; |
546 var value = attr.value; | 547 var value = attr.value; |
547 | 548 |
548 if (isTemplate(element) && | 549 if (isTemplate(element) && |
549 (name === IF || name === BIND || name === REPEAT)) { | 550 (name === IF || name === BIND || name === REPEAT)) { |
550 continue; | 551 continue; |
551 } | 552 } |
552 | 553 |
553 var tokens = parseMustaches(value, name, element, | 554 var tokens = parseMustaches(value, name, element, |
554 prepareBindingFn); | 555 prepareBindingFn); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 this.closeInstanceBindings(this.instances[i]); | 995 this.closeInstanceBindings(this.instances[i]); |
995 } | 996 } |
996 | 997 |
997 this.instances.length = 0; | 998 this.instances.length = 0; |
998 this.closeDeps(); | 999 this.closeDeps(); |
999 this.templateElement_.iterator_ = undefined; | 1000 this.templateElement_.iterator_ = undefined; |
1000 this.closed = true; | 1001 this.closed = true; |
1001 } | 1002 } |
1002 }; | 1003 }; |
1003 </script> | 1004 </script> |
OLD | NEW |