| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 class_tree_element; | 5 library class_tree_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
| 10 import 'package:observatory/src/elements/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 .expand((f) => f) | 140 .expand((f) => f) |
| 141 ..forEach((subcls) { | 141 ..forEach((subcls) { |
| 142 _mixins[subcls.id] = (_mixins[subcls.id] ?? [])..add(cls.mixin); | 142 _mixins[subcls.id] = (_mixins[subcls.id] ?? [])..add(cls.mixin); |
| 143 }); | 143 }); |
| 144 } | 144 } |
| 145 | 145 |
| 146 static Element _create(toggle) { | 146 static Element _create(toggle) { |
| 147 return new DivElement()..classes = ['class-tree-item'] | 147 return new DivElement()..classes = ['class-tree-item'] |
| 148 ..children = [ | 148 ..children = [ |
| 149 new SpanElement()..classes = ['lines'], | 149 new SpanElement()..classes = ['lines'], |
| 150 new SpanElement()..classes = ['expander'] | 150 new ButtonElement()..classes = ['expander'] |
| 151 ..onClick.listen((_) => toggle(autoToggleSingleChildNodes: true)), | 151 ..onClick.listen((_) => toggle(autoToggleSingleChildNodes: true)), |
| 152 new SpanElement()..classes = ['name'] | 152 new SpanElement()..classes = ['name'] |
| 153 ]; | 153 ]; |
| 154 } | 154 } |
| 155 | 155 |
| 156 void _update(HtmlElement el, M.Class cls, int index) { | 156 void _update(HtmlElement el, M.Class cls, int index) { |
| 157 virtualTreeUpdateLines(el.children[0], index); | 157 virtualTreeUpdateLines(el.children[0], index); |
| 158 if (cls.subclasses.isEmpty) { | 158 if (cls.subclasses.isEmpty) { |
| 159 el.children[1].text = ''; | 159 el.children[1].text = ''; |
| 160 } else { | 160 } else { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 176 : new ClassRefElement(_isolate, type.typeClass, queue: _r.queue) | 176 : new ClassRefElement(_isolate, type.typeClass, queue: _r.queue) |
| 177 ]).toList(); | 177 ]).toList(); |
| 178 children.first.text = ' with '; | 178 children.first.text = ' with '; |
| 179 return children; | 179 return children; |
| 180 } | 180 } |
| 181 | 181 |
| 182 Iterable<M.Class> _children(M.Class cls) { | 182 Iterable<M.Class> _children(M.Class cls) { |
| 183 return _subclasses[cls.id]; | 183 return _subclasses[cls.id]; |
| 184 } | 184 } |
| 185 } | 185 } |
| OLD | NEW |