| 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/src/elements/curly_block.dart'; | 8 import 'package:observatory/src/elements/curly_block.dart'; |
| 9 import 'package:observatory/src/elements/field_ref.dart'; | 9 import 'package:observatory/src/elements/field_ref.dart'; |
| 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 e.control.disabled = false; | 76 e.control.disabled = false; |
| 77 } | 77 } |
| 78 }) | 78 }) |
| 79 ]); | 79 ]); |
| 80 } | 80 } |
| 81 | 81 |
| 82 children = content; | 82 children = content; |
| 83 } | 83 } |
| 84 | 84 |
| 85 Future _refresh() async { | 85 Future _refresh() async { |
| 86 _loadedInstance = await _instances.get(_instance.id); | 86 _loadedInstance = await _instances.get(_isolate, _instance.id); |
| 87 _r.dirty(); | 87 _r.dirty(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 List<Element> _createShowMoreButton() { | 90 List<Element> _createShowMoreButton() { |
| 91 if (_loadedInstance.count == null) { | 91 if (_loadedInstance.count == null) { |
| 92 return []; | 92 return []; |
| 93 } | 93 } |
| 94 final count = _loadedInstance.count; | 94 final count = _loadedInstance.count; |
| 95 final button = new ButtonElement() | 95 final button = new ButtonElement() |
| 96 ..text = 'show next ${count}'; | 96 ..text = 'show next ${count}'; |
| 97 button.onClick.listen((_) async { | 97 button.onClick.listen((_) async { |
| 98 button.disabled = true; | 98 button.disabled = true; |
| 99 _loadedInstance = await _instances.get(_instance.id, count: count * 2); | 99 _loadedInstance = await _instances.get(_isolate, _instance.id, |
| 100 count: count * 2); |
| 100 _r.dirty(); | 101 _r.dirty(); |
| 101 }); | 102 }); |
| 102 return [button]; | 103 return [button]; |
| 103 } | 104 } |
| 104 | 105 |
| 105 List<Element> _createLink() { | 106 List<Element> _createLink() { |
| 106 switch (_instance.kind) { | 107 switch (_instance.kind) { |
| 107 case M.InstanceKind.vNull: | 108 case M.InstanceKind.vNull: |
| 108 case M.InstanceKind.bool: | 109 case M.InstanceKind.bool: |
| 109 case M.InstanceKind.int: | 110 case M.InstanceKind.int: |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } else result.add(codeUnit); | 334 } else result.add(codeUnit); |
| 334 } | 335 } |
| 335 if (wasTruncated) { | 336 if (wasTruncated) { |
| 336 result.addAll("...".codeUnits); | 337 result.addAll("...".codeUnits); |
| 337 } else { | 338 } else { |
| 338 result.add("'".codeUnitAt(0)); | 339 result.add("'".codeUnitAt(0)); |
| 339 } | 340 } |
| 340 return new String.fromCharCodes(result); | 341 return new String.fromCharCodes(result); |
| 341 } | 342 } |
| 342 } | 343 } |
| OLD | NEW |