OLD | NEW |
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 polymer; | 5 part of polymer; |
6 | 6 |
7 /** | 7 /** |
8 * Use this annotation to publish a field as an attribute. For example: | 8 * Use this annotation to publish a field as an attribute. For example: |
9 * | 9 * |
10 * class MyPlaybackElement extends PolymerElement { | 10 * class MyPlaybackElement extends PolymerElement { |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 super.close(); | 891 super.close(); |
892 } | 892 } |
893 | 893 |
894 void boundValueChanged(newValue) { | 894 void boundValueChanged(newValue) { |
895 _lastValue = newValue; | 895 _lastValue = newValue; |
896 _target.setField(_property, newValue); | 896 _target.setField(_property, newValue); |
897 } | 897 } |
898 | 898 |
899 void _propertyValueChanged(List<ChangeRecord> records) { | 899 void _propertyValueChanged(List<ChangeRecord> records) { |
900 for (var record in records) { | 900 for (var record in records) { |
901 if (record.changes(_property)) { | 901 if (record is PropertyChangeRecord && record.name == _property) { |
902 final newValue = _target.getField(_property).reflectee; | 902 final newValue = _target.getField(_property).reflectee; |
903 if (!identical(_lastValue, newValue)) { | 903 if (!identical(_lastValue, newValue)) { |
904 value = newValue; | 904 value = newValue; |
905 } | 905 } |
906 return; | 906 return; |
907 } | 907 } |
908 } | 908 } |
909 } | 909 } |
910 } | 910 } |
911 | 911 |
(...skipping 23 matching lines...) Expand all Loading... |
935 | 935 |
936 final Expando _shadowHost = new Expando<Polymer>(); | 936 final Expando _shadowHost = new Expando<Polymer>(); |
937 | 937 |
938 final Expando _eventHandledTable = new Expando<Set<Node>>(); | 938 final Expando _eventHandledTable = new Expando<Set<Node>>(); |
939 | 939 |
940 /** | 940 /** |
941 * Base class for PolymerElements deriving from HtmlElement. | 941 * Base class for PolymerElements deriving from HtmlElement. |
942 * | 942 * |
943 * See [Polymer]. | 943 * See [Polymer]. |
944 */ | 944 */ |
945 class PolymerElement extends HtmlElement with Polymer, ObservableMixin { | 945 class PolymerElement extends HtmlElement with Polymer, Observable { |
946 PolymerElement.created() : super.created() { | 946 PolymerElement.created() : super.created() { |
947 polymerCreated(); | 947 polymerCreated(); |
948 } | 948 } |
949 } | 949 } |
OLD | NEW |