| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 'rowColor4', 'rowColor5', 'rowColor6', 'rowColor7', | 183 'rowColor4', 'rowColor5', 'rowColor6', 'rowColor7', |
| 184 'rowColor8']; | 184 'rowColor8']; |
| 185 var index = (row.depth - 1) % colors.length; | 185 var index = (row.depth - 1) % colors.length; |
| 186 return colors[index]; | 186 return colors[index]; |
| 187 } | 187 } |
| 188 | 188 |
| 189 @observable void toggleExpanded(Event e, var detail, Element target) { | 189 @observable void toggleExpanded(Event e, var detail, Element target) { |
| 190 // We only want to expand a tree row if the target of the click is | 190 // We only want to expand a tree row if the target of the click is |
| 191 // the table cell (passed in as target) or the span containing the | 191 // the table cell (passed in as target) or the span containing the |
| 192 // expander symbol (#expand). | 192 // expander symbol (#expand). |
| 193 if ((e.target.id != 'expand') && (e.target != target)) { | 193 var eventTarget = e.target; |
| 194 if ((eventTarget.id != 'expand') && (e.target != target)) { |
| 194 // Target of click was not the expander span or the table cell. | 195 // Target of click was not the expander span or the table cell. |
| 195 return; | 196 return; |
| 196 } | 197 } |
| 197 var row = target.parent; | 198 var row = target.parent; |
| 198 if (row is TableRowElement) { | 199 if (row is TableRowElement) { |
| 199 // Subtract 1 to get 0 based indexing. | 200 // Subtract 1 to get 0 based indexing. |
| 200 try { | 201 try { |
| 201 tree.toggle(row.rowIndex - 1); | 202 tree.toggle(row.rowIndex - 1); |
| 202 } catch (e, stackTrace) { | 203 } catch (e, stackTrace) { |
| 203 Logger.root.warning('toggleExpanded', e, stackTrace); | 204 Logger.root.warning('toggleExpanded', e, stackTrace); |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 } | 207 } |
| 207 } | 208 } |
| OLD | NEW |