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 'observatory_element.dart'; | 7 import 'observatory_element.dart'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
10 import 'package:observatory/app.dart'; | 10 import 'package:observatory/app.dart'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 super.onShow(); | 24 super.onShow(); |
25 if (children.length == 0) { | 25 if (children.length == 0) { |
26 for (var subclass in cls.subclasses) { | 26 for (var subclass in cls.subclasses) { |
27 if (subclass.isPatch) { | 27 if (subclass.isPatch) { |
28 continue; | 28 continue; |
29 } | 29 } |
30 var row = new ClassTreeRow(isolate, subclass, tree, this); | 30 var row = new ClassTreeRow(isolate, subclass, tree, this); |
31 children.add(row); | 31 children.add(row); |
32 } | 32 } |
33 } | 33 } |
34 var classCell = tableColumns[0]; | 34 var classCell = flexColumns[0]; |
35 // Enable expansion by clicking anywhere on the class column. | 35 classCell.style.justifyContent = 'flex-start'; |
36 classCell.onClick.listen(onClick); | |
37 | |
38 var classRef = new Element.tag('class-ref'); | 36 var classRef = new Element.tag('class-ref'); |
39 classRef.ref = cls; | 37 classRef.ref = cls; |
| 38 classRef.style.alignSelf = 'center'; |
40 classCell.children.add(classRef); | 39 classCell.children.add(classRef); |
41 } | 40 } |
42 | 41 |
43 bool hasChildren() { | 42 bool hasChildren() { |
44 return cls.subclasses.length > 0; | 43 return cls.subclasses.length > 0; |
45 } | 44 } |
46 } | 45 } |
47 | 46 |
48 | 47 |
49 @CustomTag('class-tree') | 48 @CustomTag('class-tree') |
(...skipping 29 matching lines...) Expand all Loading... |
79 } catch (e, stackTrace) { | 78 } catch (e, stackTrace) { |
80 Logger.root.warning('_update', e, stackTrace); | 79 Logger.root.warning('_update', e, stackTrace); |
81 } | 80 } |
82 // Check if we only have one node at the root and expand it. | 81 // Check if we only have one node at the root and expand it. |
83 if (tree.rows.length == 1) { | 82 if (tree.rows.length == 1) { |
84 tree.toggle(tree.rows[0]); | 83 tree.toggle(tree.rows[0]); |
85 } | 84 } |
86 notifyPropertyChange(#tree, null, tree); | 85 notifyPropertyChange(#tree, null, tree); |
87 } | 86 } |
88 } | 87 } |
OLD | NEW |