Chromium Code Reviews| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 @observable String padding(TableTreeRow row) { | 226 @observable String padding(TableTreeRow row) { |
| 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) { |
|
turnidge
2014/04/01 19:42:48
A comment here would make this more clear.
Cutch
2014/04/02 18:26:52
Done.
| |
| 237 if ((e.target.id != 'expand') && (e.target != target)) { | |
| 238 return; | |
| 239 } | |
| 237 var row = target.parent; | 240 var row = target.parent; |
| 238 if (row is TableRowElement) { | 241 if (row is TableRowElement) { |
| 239 // Subtract 1 to get 0 based indexing. | 242 // Subtract 1 to get 0 based indexing. |
| 240 tree.toggle(row.rowIndex - 1); | 243 tree.toggle(row.rowIndex - 1); |
| 241 } | 244 } |
| 242 } | 245 } |
| 243 | 246 |
| 244 } | 247 } |
| OLD | NEW |