| 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 'package:logging/logging.dart'; | 7 import 'package:logging/logging.dart'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 import 'service_ref.dart'; | 9 import 'service_ref.dart'; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return ref['preview']; | 21 return ref['preview']; |
| 22 } | 22 } |
| 23 | 23 |
| 24 void toggleExpand(var a, var b, var c) { | 24 void toggleExpand(var a, var b, var c) { |
| 25 if (expanded) { | 25 if (expanded) { |
| 26 ref['fields'] = null; | 26 ref['fields'] = null; |
| 27 ref['elements'] = null; | 27 ref['elements'] = null; |
| 28 expanded = false; | 28 expanded = false; |
| 29 } else { | 29 } else { |
| 30 app.requestManager.requestMap(url).then((map) { | 30 app.requestManager.requestMap(url).then((map) { |
| 31 print(map); | |
| 32 ref['fields'] = map['fields']; | 31 ref['fields'] = map['fields']; |
| 33 ref['elements'] = map['elements']; | 32 ref['elements'] = map['elements']; |
| 34 ref['length'] = map['length']; | 33 ref['length'] = map['length']; |
| 35 expanded = true; | 34 expanded = true; |
| 36 }).catchError((e, trace) { | 35 }).catchError((e, trace) { |
| 37 Logger.root.severe('Error while expanding instance-ref: $e\n$trace'); | 36 Logger.root.severe('Error while expanding instance-ref: $e\n$trace'); |
| 38 }); | 37 }); |
| 39 } | 38 } |
| 40 } | 39 } |
| 41 } | 40 } |
| OLD | NEW |