| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 return 'padding-left: ${row.depth * 16}px;'; | 227 return 'padding-left: ${row.depth * 16}px;'; |
| 228 } | 228 } |
| 229 | 229 |
| 230 @observable String coloring(TableTreeRow row) { | 230 @observable String coloring(TableTreeRow row) { |
| 231 const colors = const ['active', 'success', 'warning', 'danger', 'info']; | 231 const colors = const ['active', 'success', 'warning', 'danger', 'info']; |
| 232 var index = row.depth % colors.length; | 232 var index = row.depth % colors.length; |
| 233 return colors[index]; | 233 return colors[index]; |
| 234 } | 234 } |
| 235 | 235 |
| 236 @observable void toggleExpanded(Event e, var detail, Element target) { | 236 @observable void toggleExpanded(Event e, var detail, Element target) { |
| 237 // We only want to expand a tree row if the target of the click is |
| 238 // the table cell (passed in as target) or the span containing the |
| 239 // expander symbol (#expand). |
| 240 if ((e.target.id != 'expand') && (e.target != target)) { |
| 241 // Target of click was not the expander span or the table cell. |
| 242 return; |
| 243 } |
| 237 var row = target.parent; | 244 var row = target.parent; |
| 238 if (row is TableRowElement) { | 245 if (row is TableRowElement) { |
| 239 // Subtract 1 to get 0 based indexing. | 246 // Subtract 1 to get 0 based indexing. |
| 240 tree.toggle(row.rowIndex - 1); | 247 tree.toggle(row.rowIndex - 1); |
| 241 } | 248 } |
| 242 } | 249 } |
| 243 | |
| 244 } | 250 } |
| OLD | NEW |