Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: runtime/bin/vmservice/client/lib/src/app/view_model.dart

Issue 266043004: Small cleanup to Code and Profiler pages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/app/view_model.dart
diff --git a/runtime/bin/vmservice/client/lib/src/app/view_model.dart b/runtime/bin/vmservice/client/lib/src/app/view_model.dart
index 993ff72af02b88f6b3730f5fa6e5e04b49a50264..0b90a993b6ce476d1cf305c2a60e4e2129c9e6b8 100644
--- a/runtime/bin/vmservice/client/lib/src/app/view_model.dart
+++ b/runtime/bin/vmservice/client/lib/src/app/view_model.dart
@@ -11,13 +11,21 @@ abstract class TableTreeRow extends Observable {
@observable final List<String> columns = [];
static const arrowRight = '\u2192';
static const arrowDownRight = '\u21b3';
+ static const showExpanderStyle = 'cursor: pointer;';
+ static const hideExpanderStyle = 'visibility:hidden;';
+
// TODO(johnmccutchan): Move expander display decisions into html once
// tables and templates are better supported.
@observable String expander = arrowRight;
+ @observable String expanderStyle = showExpanderStyle;
TableTreeRow(TableTreeRow parent) :
parent = parent,
- depth = parent != null ? parent.depth+1 : 0;
+ depth = parent != null ? parent.depth+1 : 0 {
+ if (!hasChildren()) {
+ expanderStyle = hideExpanderStyle;
+ }
+ }
bool _expanded = false;
bool get expanded => _expanded;
@@ -41,6 +49,8 @@ abstract class TableTreeRow extends Observable {
return expanded;
}
+ bool hasChildren();
+
/// Fired when the tree row is expanded. Add children rows here.
void onShow();

Powered by Google App Engine
This is Rietveld 408576698