Index: runtime/observatory/lib/src/elements/nav/library_menu.dart |
diff --git a/runtime/observatory/lib/src/elements/nav/library_menu.dart b/runtime/observatory/lib/src/elements/nav/library_menu.dart |
index 36160d6ca45da15304caca6159644fea6029dabe..783adf3693f03a9b35c63f5c0667b168a2eea854 100644 |
--- a/runtime/observatory/lib/src/elements/nav/library_menu.dart |
+++ b/runtime/observatory/lib/src/elements/nav/library_menu.dart |
@@ -5,43 +5,43 @@ |
import 'dart:html'; |
import 'dart:async'; |
import 'package:observatory/models.dart' as M show IsolateRef, LibraryRef; |
+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 NavLibraryMenuElement extends HtmlElement implements Renderable { |
- static const tag = const Tag<NavLibraryMenuElement>('nav-library-menu', |
- dependencies: const [NavMenuElement.tag]); |
+ static const tag = const Tag<NavLibraryMenuElement>('nav-library-menu'); |
RenderingScheduler _r; |
Stream<RenderedEvent<NavLibraryMenuElement>> get onRendered => _r.onRendered; |
- bool _last; |
M.IsolateRef _isolate; |
M.LibraryRef _library; |
+ Iterable<Element> _content = const []; |
- bool get last => _last; |
M.IsolateRef get isolate => _isolate; |
M.LibraryRef get library => _library; |
- |
- 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 NavLibraryMenuElement(M.IsolateRef isolate, M.LibraryRef library, |
- {bool last: false, RenderingQueue queue}) { |
+ {RenderingQueue queue}) { |
assert(isolate != null); |
assert(library != null); |
- assert(last != null); |
NavLibraryMenuElement e = document.createElement(tag.name); |
e._r = new RenderingScheduler(e, queue: queue); |
e._isolate = isolate; |
e._library = library; |
- e._last = last; |
return e; |
} |
- NavLibraryMenuElement.created() : super.created() { createShadowRoot(); } |
+ NavLibraryMenuElement.created() : super.created(); |
@override |
void attached() { |
@@ -52,15 +52,14 @@ class NavLibraryMenuElement extends HtmlElement implements Renderable { |
@override |
void detached() { |
super.detached(); |
+ children = []; |
_r.disable(notify: true); |
- shadowRoot.children = []; |
} |
void render() { |
- shadowRoot.children = [ |
- new NavMenuElement(library.name, last: last, queue: _r.queue, |
+ children = [ |
+ navMenu(library.name, content: _content, |
link: Uris.inspect(isolate, object: library).toString()) |
- ..children = [new ContentElement()] |
]; |
} |
} |