| 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 isolate_profile_element; | 5 library isolate_profile_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
| 9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
| 10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 var root = profile.isolate.profileTrieRoot; | 156 var root = profile.isolate.profileTrieRoot; |
| 157 if (root == null) { | 157 if (root == null) { |
| 158 return; | 158 return; |
| 159 } | 159 } |
| 160 try { | 160 try { |
| 161 tree.initialize( | 161 tree.initialize( |
| 162 new ProfileCodeTrieNodeTreeRow(profile, root, root, null)); | 162 new ProfileCodeTrieNodeTreeRow(profile, root, root, null)); |
| 163 } catch (e, stackTrace) { | 163 } catch (e, stackTrace) { |
| 164 Logger.root.warning('_buildStackTree', e, stackTrace); | 164 Logger.root.warning('_buildStackTree', e, stackTrace); |
| 165 } | 165 } |
| 166 // Check if we only have one node at the root and expand it. |
| 167 if (tree.rows.length == 1) { |
| 168 tree.toggle(0); |
| 169 } |
| 166 notifyPropertyChange(#tree, null, tree); | 170 notifyPropertyChange(#tree, null, tree); |
| 167 } | 171 } |
| 168 | 172 |
| 169 void _buildTree() { | 173 void _buildTree() { |
| 170 _buildStackTree(); | 174 _buildStackTree(); |
| 171 } | 175 } |
| 172 | 176 |
| 173 @observable String padding(TableTreeRow row) { | 177 @observable String padding(TableTreeRow row) { |
| 174 return 'padding-left: ${row.depth * 16}px;'; | 178 return 'padding-left: ${row.depth * 16}px;'; |
| 175 } | 179 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 194 if (row is TableRowElement) { | 198 if (row is TableRowElement) { |
| 195 // Subtract 1 to get 0 based indexing. | 199 // Subtract 1 to get 0 based indexing. |
| 196 try { | 200 try { |
| 197 tree.toggle(row.rowIndex - 1); | 201 tree.toggle(row.rowIndex - 1); |
| 198 } catch (e, stackTrace) { | 202 } catch (e, stackTrace) { |
| 199 Logger.root.warning('toggleExpanded', e, stackTrace); | 203 Logger.root.warning('toggleExpanded', e, stackTrace); |
| 200 } | 204 } |
| 201 } | 205 } |
| 202 } | 206 } |
| 203 } | 207 } |
| OLD | NEW |