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

Unified Diff: runtime/observatory/lib/src/elements/nav/menu_item.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/menu_item.dart
diff --git a/runtime/observatory/lib/src/elements/nav/menu_item.dart b/runtime/observatory/lib/src/elements/nav/menu_item.dart
index 03ced3d4edec07687015c21c88318e65784bdd9c..5be6723ff053ab5b00d431fd4968cc32f6f8c9a1 100644
--- a/runtime/observatory/lib/src/elements/nav/menu_item.dart
+++ b/runtime/observatory/lib/src/elements/nav/menu_item.dart
@@ -8,46 +8,7 @@ import 'package:observatory/src/elements/helpers/tag.dart';
import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
class NavMenuItemElement extends HtmlElement implements Renderable {
- static final StyleElement _style = () {
- var style = new StyleElement();
- style.text = '''li.nav-menu-item {
- float: none;
- border-top: 1px solid #677;
- border-bottom: 1px solid #556; position: relative;
- }
- li.nav-menu-item:hover {
- background: #455;
- }
- li.nav-menu-item > a {
- display: block;
- padding: 12px 12px;
- color: white;
- text-decoration: none;
- }
- li.nav-menu-item > ul {
- display: none;
- position: absolute;
- top:0;
- left: 100%;
- list-style: none;
- padding: 0;
- margin-left: 0;
- width: auto;
- z-index: 1000;
- font: 400 16px \'Montserrat\', sans-serif;
- color: white;
- background: #567;
- }
- li.nav-menu-item > ul:after {
- content: ""; clear: both; display: block;
- }
- li.nav-menu-item:hover > ul {
- display: block;
- }''';
- return style;
- }();
-
- static const tag = const Tag<NavMenuItemElement>('nav-menu-item-wrapped');
+ static const tag = const Tag<NavMenuItemElement>('nav-menu-item');
RenderingScheduler _r;
@@ -55,12 +16,18 @@ class NavMenuItemElement extends HtmlElement implements Renderable {
String _label;
String _link;
+ Iterable<Element> _content = const [];
String get label => _label;
String get link => _link;
-
+ Iterable<Element> get content => _content;
+
set label(String value) => _label = _r.checkAndReact(_label, value);
set link(String value) => _link = _r.checkAndReact(_link, value);
+ set content(Iterable<Element> value) {
+ _content = value.toList();
+ _r.dirty();
+ }
factory NavMenuItemElement(String label, {String link,
@@ -73,7 +40,7 @@ class NavMenuItemElement extends HtmlElement implements Renderable {
return e;
}
- NavMenuItemElement.created() : super.created() { createShadowRoot(); }
+ NavMenuItemElement.created() : super.created();
@override
void attached() {
@@ -85,21 +52,18 @@ class NavMenuItemElement extends HtmlElement implements Renderable {
void detached() {
super.detached();
_r.disable(notify: true);
- shadowRoot.children = [];
+ children = [];
}
void render() {
- shadowRoot.children = [
- _style.clone(true),
+ children = [
new LIElement()
..classes = ['nav-menu-item']
..children = [
new AnchorElement(href: link)
..text = label,
new UListElement()
- ..children = [
- new ContentElement()
- ]
+ ..children = _content
]
];
}
« no previous file with comments | « runtime/observatory/lib/src/elements/nav/menu.dart ('k') | runtime/observatory/lib/src/elements/nav/menu_item_wrapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698