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

Unified Diff: runtime/observatory/lib/src/elements/nav/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/menu.dart
diff --git a/runtime/observatory/lib/src/elements/nav/menu.dart b/runtime/observatory/lib/src/elements/nav/menu.dart
deleted file mode 100644
index 2624ad7986a6887075dfc9b67b6d5ab427c53047..0000000000000000000000000000000000000000
--- a/runtime/observatory/lib/src/elements/nav/menu.dart
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:html';
-import 'dart:async';
-import 'package:observatory/src/elements/helpers/tag.dart';
-import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
-
-class NavMenuElement extends HtmlElement implements Renderable {
- static final StyleElement _style = () {
- var style = new StyleElement();
- style.text = '''li.nav-menu_label, li.nav-menu_spacer {
- float: left;
- }
- li.nav-menu_label > a, li.nav-menu_spacer {
- display: block;
- padding: 12px 8px;
- color: White;
- text-decoration: none;
- }
- li.nav-menu_label:hover {
- background: #455;
- }
- li.nav-menu_label > ul {
- display: none;
- position: absolute;
- top: 98%;
- list-style: none;
- margin: 0;
- padding: 0;
- width: auto;
- z-index: 1000;
- font: 400 16px \'Montserrat\', sans-serif;
- color: white;
- background: #567;
- }
- li.nav-menu_label > ul:after {
- content: ""; clear: both; display: block;
- }
- li.nav-menu_label:hover > ul {
- display: block;
- }''';
- return style;
- }();
-
- static const tag = const Tag<NavMenuElement>('nav-menu-wrapped');
-
- RenderingScheduler _r;
-
- Stream<RenderedEvent<NavMenuElement>> get onRendered => _r.onRendered;
-
- String _label;
- String _link;
- bool _last;
-
- String get label => _label;
- String get link => _link;
- bool get last => _last;
-
- set label(String value) => _label = _r.checkAndReact(_label, value);
- set link(String value) => _link = _r.checkAndReact(_link, value);
- set last(bool value) => _last = _r.checkAndReact(_link, value);
-
- factory NavMenuElement(String label, {String link, bool last: false,
- RenderingQueue queue}) {
- assert(label != null);
- assert(last != null);
- NavMenuElement e = document.createElement(tag.name);
- e._r = new RenderingScheduler(e, queue: queue);
- e._label = label;
- e._link = link;
- e._last = last;
- return e;
- }
-
- NavMenuElement.created() : super.created() { createShadowRoot(); }
-
- @override
- void attached() {
- super.attached();
- _r.enable();
- }
-
- @override
- void detached() {
- super.detached();
- _r.disable(notify: true);
- shadowRoot.children = [];
- }
-
- void render() {
- List<Element> children = [
- _style.clone(true),
- new LIElement()
- ..classes = ['nav-menu_label']
- ..children = [
- new AnchorElement(href: link)
- ..text = label,
- new UListElement()
- ..children = [
- new ContentElement()
- ]
- ]
- ];
- if (!last) {
- children.add(
- new LIElement()
- ..classes = ['nav-menu_spacer']
- ..innerHtml = '&gt;'
- );
- }
- shadowRoot.children = children;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698