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

Unified Diff: runtime/observatory/lib/src/elements/context_ref.dart

Issue 2970443002: Disable expansion of VirtualTree and VirtualCollection items (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/field_ref.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/context_ref.dart
diff --git a/runtime/observatory/lib/src/elements/context_ref.dart b/runtime/observatory/lib/src/elements/context_ref.dart
index 63d1464276f4337e2c6902679db33715ae2915f3..5b6bcb0c9875b818c6a5673e80ce4aa740d751c1 100644
--- a/runtime/observatory/lib/src/elements/context_ref.dart
+++ b/runtime/observatory/lib/src/elements/context_ref.dart
@@ -23,6 +23,7 @@ class ContextRefElement extends HtmlElement implements Renderable {
M.ContextRef _context;
M.ObjectRepository _objects;
M.Context _loadedContext;
+ bool _expandable;
bool _expanded = false;
M.IsolateRef get isolate => _isolate;
@@ -30,7 +31,7 @@ class ContextRefElement extends HtmlElement implements Renderable {
factory ContextRefElement(
M.IsolateRef isolate, M.ContextRef context, M.ObjectRepository objects,
- {RenderingQueue queue}) {
+ {RenderingQueue queue, bool expandable: true}) {
assert(isolate != null);
assert(context != null);
assert(objects != null);
@@ -39,6 +40,7 @@ class ContextRefElement extends HtmlElement implements Renderable {
e._isolate = isolate;
e._context = context;
e._objects = objects;
+ e._expandable = expandable;
return e;
}
@@ -63,7 +65,7 @@ class ContextRefElement extends HtmlElement implements Renderable {
}
void render() {
- children = [
+ var children = [
new AnchorElement(href: Uris.inspect(_isolate, object: _context))
..children = [
new SpanElement()
@@ -71,22 +73,27 @@ class ContextRefElement extends HtmlElement implements Renderable {
..text = 'Context',
new SpanElement()..text = ' (${_context.length})',
],
- new SpanElement()..text = ' ',
- new CurlyBlockElement(expanded: _expanded, queue: _r.queue)
- ..content = [
- new DivElement()
- ..classes = ['indent']
- ..children = _createValue()
- ]
- ..onToggle.listen((e) async {
- _expanded = e.control.expanded;
- if (_expanded) {
- e.control.disabled = true;
- await _refresh();
- e.control.disabled = false;
- }
- })
];
+ if (_expandable) {
+ children.addAll([
+ new SpanElement()..text = ' ',
+ new CurlyBlockElement(expanded: _expanded, queue: _r.queue)
+ ..content = [
+ new DivElement()
+ ..classes = ['indent']
+ ..children = _createValue()
+ ]
+ ..onToggle.listen((e) async {
+ _expanded = e.control.expanded;
+ if (_expanded) {
+ e.control.disabled = true;
+ await _refresh();
+ e.control.disabled = false;
+ }
+ })
+ ]);
+ }
+ this.children = children;
}
List<Element> _createValue() {
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/field_ref.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698