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

Side by Side Diff: runtime/observatory/lib/src/elements/nav/top_menu_wrapper.dart

Issue 2159273003: Converted Observatory top-nav-menu element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 class NavTopMenuElementWrapper extends HtmlElement {
13 static final binder = new Binder<NavTopMenuElementWrapper>(
14 const [const Binding('last')]);
15
16 static const tag = const Tag<NavTopMenuElementWrapper>('top-nav-menu');
17
18 bool _last = false;
19 bool get last => _last;
20 set last(bool value) {
21 _last = value; render();
22 }
23
24 NavTopMenuElementWrapper.created() : super.created() {
25 binder.registerCallback(this);
26 _last = getAttribute('') != null;
Cutch 2016/07/20 13:50:45 what is this checking?
cbernaschina 2016/07/20 17:17:00 It is checking the presence of the attribute. If i
cbernaschina 2016/07/20 17:56:12 Done.
27 createShadowRoot();
28 render();
29 }
30
31 @override
32 void attached() {
33 super.attached();
34 render();
35 }
36
37 void render() {
38 shadowRoot.children = [];
39 if (_last == null) return;
40
41 shadowRoot.children = [
42 new NavTopMenuElement(last: last, queue: ObservatoryApplication.app.queue)
43 ..children = [new ContentElement()]
44 ];
45 }
46 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/nav/top_menu.dart ('k') | runtime/observatory/lib/src/elements/nav_bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698