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

Side by Side Diff: runtime/observatory/lib/src/elements/nav/bar.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:html';
6 import 'dart:async';
7 import 'package:observatory/src/elements/helpers/tag.dart';
8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
9
10 class NavBarElement extends HtmlElement implements Renderable {
11 static final StyleElement _style = () {
12 var style = new StyleElement();
13 style.text = 'nav.nav-bar {'
14 'line-height: normal;'
15 'position: fixed;'
16 'top: 0;'
17 'width: 100%;'
18 'z-index: 1000;'
19 '}'
20 'nav.nav-bar > ul {'
21 'display: inline-table;'
22 'position: relative;'
23 'list-style: none;'
24 'padding-left: 0;'
25 'margin: 0;'
26 'width: 100%;'
27 'z-index: 1000;'
28 'font: 400 16px \'Montserrat\', sans-serif;'
29 'color: white;'
30 'background-color: #0489c3;'
31 '}';
32 return style;
33 }();
34
35 static const tag = const Tag<NavBarElement>('nav-bar');
36
37 RenderingScheduler _r;
38
39 Stream<RenderedEvent<NavBarElement>> get onRendered => _r.onRendered;
40
41 factory NavBarElement({RenderingQueue queue}) {
42 NavBarElement e = document.createElement(tag.name);
43 e._r = new RenderingScheduler(e, queue: queue);
44 return e;
45 }
46
47 NavBarElement.created() : super.created() {
48 // TODO(cbernaschina) remove when no more needed.
49 _r = new RenderingScheduler(this);
50 createShadowRoot();
51 }
52
53 @override
54 void attached() { super.attached(); _r.enable(); }
55
56 @override
57 void detached() {
58 super.detached(); _r.disable(notify: true);
59 shadowRoot.children = [];
60 }
61
62 void render() {
63 shadowRoot.children = [
64 _style.clone(true),
65 document.createElement('nav')
66 ..classes = ['nav-bar']
67 ..children = [
68 new UListElement()
69 ..children = [
70 new ContentElement()
71 ],
72 ],
73 new DivElement()
74 ];
75 }
76 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/metrics.dart ('k') | runtime/observatory/lib/src/elements/nav/class_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698