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

Unified Diff: runtime/observatory/lib/src/elements/nav/class_menu.dart

Issue 2310003004: Removed polymer & mirror from Observatory (Closed)
Patch Set: Fixed crash in heap-map page Created 4 years, 3 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/observatory/lib/src/elements/nav/class_menu.dart
diff --git a/runtime/observatory/lib/src/elements/nav/class_menu.dart b/runtime/observatory/lib/src/elements/nav/class_menu.dart
index d8ed510a8675655b54e80d9a4d9f2f0d45512fee..6c13336584961143ce793b9f76b3f2572cc220ce 100644
--- a/runtime/observatory/lib/src/elements/nav/class_menu.dart
+++ b/runtime/observatory/lib/src/elements/nav/class_menu.dart
@@ -5,41 +5,43 @@
import 'dart:html';
import 'dart:async';
import 'package:observatory/models.dart' as M show IsolateRef, ClassRef;
+import 'package:observatory/src/elements/helpers/nav_menu.dart';
import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
import 'package:observatory/src/elements/helpers/tag.dart';
import 'package:observatory/src/elements/helpers/uris.dart';
-import 'package:observatory/src/elements/nav/menu.dart';
class NavClassMenuElement extends HtmlElement implements Renderable {
- static const tag = const Tag<NavClassMenuElement>('nav-class-menu',
- dependencies: const [NavMenuElement.tag]);
+ static const tag = const Tag<NavClassMenuElement>('nav-class-menu');
RenderingScheduler _r;
Stream<RenderedEvent<NavClassMenuElement>> get onRendered => _r.onRendered;
- bool _last;
M.IsolateRef _isolate;
M.ClassRef _cls;
- bool get last => _last;
+ Iterable<Element> _content = const [];
+
M.IsolateRef get isolate => _isolate;
M.ClassRef get cls => _cls;
- set last(bool value) => _last = _r.checkAndReact(_last, value);
+ Iterable<Element> get content => _content;
+
+ set content(Iterable<Element> value) {
+ _content = value.toList();
+ _r.dirty();
+ }
factory NavClassMenuElement(M.IsolateRef isolate, M.ClassRef cls,
- {bool last: false, RenderingQueue queue}) {
+ {RenderingQueue queue}) {
assert(isolate != null);
assert(cls != null);
- assert(last != null);
NavClassMenuElement e = document.createElement(tag.name);
e._r = new RenderingScheduler(e, queue: queue);
e._isolate = isolate;
e._cls = cls;
- e._last = last;
return e;
}
- NavClassMenuElement.created() : super.created() { createShadowRoot(); }
+ NavClassMenuElement.created() : super.created();
@override
void attached() {
@@ -50,15 +52,14 @@ class NavClassMenuElement extends HtmlElement implements Renderable {
@override
void detached() {
super.detached();
+ children = [];
_r.disable(notify: true);
- shadowRoot.children = [];
}
void render() {
- shadowRoot.children = [
- new NavMenuElement(cls.name, last: last, queue: _r.queue,
- link: Uris.inspect(isolate, object: cls))
- ..children = [new ContentElement()]
+ children = [
+ navMenu(cls.name, content: _content,
+ link: Uris.inspect(isolate, object: cls))
];
}
}
« no previous file with comments | « runtime/observatory/lib/src/elements/nav/bar.dart ('k') | runtime/observatory/lib/src/elements/nav/class_menu_wrapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698