| 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 library instance_ref_element; | 5 library instance_ref_element; |
| 6 | 6 |
| 7 import 'dart:async'; |
| 7 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 8 import 'package:observatory/service.dart'; | 9 import 'package:observatory/service.dart'; |
| 9 import 'service_ref.dart'; | 10 import 'service_ref.dart'; |
| 10 | 11 |
| 11 @CustomTag('instance-ref') | 12 @CustomTag('instance-ref') |
| 12 class InstanceRefElement extends ServiceRefElement { | 13 class InstanceRefElement extends ServiceRefElement { |
| 13 InstanceRefElement.created() : super.created(); | 14 InstanceRefElement.created() : super.created(); |
| 14 | 15 |
| 15 String get hoverText { | 16 String get hoverText { |
| 16 if (ref != null) { | 17 if (ref != null) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 Instance refMap = ref; | 52 Instance refMap = ref; |
| 52 refMap.fields = null; | 53 refMap.fields = null; |
| 53 refMap.elements = null; | 54 refMap.elements = null; |
| 54 onDone(); | 55 onDone(); |
| 55 } | 56 } |
| 56 } | 57 } |
| 57 | 58 |
| 58 String makeExpandKey(String key) { | 59 String makeExpandKey(String key) { |
| 59 return '${expandKey}/${key}'; | 60 return '${expandKey}/${key}'; |
| 60 } | 61 } |
| 62 |
| 63 Future showMore() async { |
| 64 Instance instance = ref; |
| 65 if (instance.isList) { |
| 66 await instance.reload(count: instance.elements.length * 2); |
| 67 } else if (instance.isMap) { |
| 68 await instance.reload(count: instance.associations.length * 2); |
| 69 } else if (instance.isTypedData) { |
| 70 await instance.reload(count: instance.typedElements.length * 2); |
| 71 } |
| 72 } |
| 61 } | 73 } |
| OLD | NEW |