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

Side by Side Diff: runtime/observatory/lib/src/elements/nav/top_menu_wrapper.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
7 import 'package:observatory/app.dart';
8 import 'package:observatory/src/elements/helpers/tag.dart';
9 import 'package:observatory/src/elements/shims/binding.dart';
10 import 'package:observatory/src/elements/nav/top_menu.dart';
11
12 @bindable
13 class NavTopMenuElementWrapper extends HtmlElement {
14 static const binder = const Binder<NavTopMenuElementWrapper>(const {
15 'last': #last
16 });
17
18 static const tag = const Tag<NavTopMenuElementWrapper>('top-nav-menu');
19
20 bool _last = false;
21
22 bool get last => _last;
23
24 set last(bool value) {
25 _last = value;
26 render();
27 }
28
29 NavTopMenuElementWrapper.created() : super.created() {
30 binder.registerCallback(this);
31 _last = _getBoolAttribute('last');
32 createShadowRoot();
33 render();
34 }
35
36 @override
37 void attached() {
38 super.attached();
39 render();
40 }
41
42 void render() {
43 shadowRoot.children = [];
44 if (_last == null) {
45 return;
46 }
47
48 shadowRoot.children = [
49 new NavTopMenuElement(last: last, queue: ObservatoryApplication.app.queue)
50 ..children = [new ContentElement()]
51 ];
52 }
53
54 bool _getBoolAttribute(String name) {
55 final String value = getAttribute(name);
56 return !(value == null || value == 'false');
57 }
58 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/nav/top_menu.dart ('k') | runtime/observatory/lib/src/elements/nav/vm_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698