OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
7 import 'package:observatory/src/elements/helpers/tag.dart'; | 8 import 'package:observatory/src/elements/helpers/tag.dart'; |
8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 9 import 'package:observatory/src/elements/helpers/uris.dart'; |
9 import 'package:observatory/src/elements/nav/menu.dart'; | 10 import 'package:observatory/src/elements/nav/menu.dart'; |
10 import 'package:observatory/src/elements/nav/menu_item.dart'; | 11 import 'package:observatory/src/elements/nav/menu_item.dart'; |
11 | 12 |
12 class NavTopMenuElement extends HtmlElement implements Renderable { | 13 class NavTopMenuElement extends HtmlElement implements Renderable { |
13 static const tag = const Tag<NavTopMenuElement>('nav-top-menu', | 14 static const tag = const Tag<NavTopMenuElement>('nav-top-menu', |
14 dependencies: const [NavMenuElement.tag, | 15 dependencies: const [NavMenuElement.tag, |
15 NavMenuItemElement.tag]); | 16 NavMenuItemElement.tag]); |
16 | 17 |
17 RenderingScheduler _r; | 18 RenderingScheduler _r; |
18 | 19 |
(...skipping 21 matching lines...) Expand all Loading... |
40 | 41 |
41 @override | 42 @override |
42 void detached() { | 43 void detached() { |
43 super.detached(); | 44 super.detached(); |
44 _r.disable(notify: true); | 45 _r.disable(notify: true); |
45 shadowRoot.children = []; | 46 shadowRoot.children = []; |
46 } | 47 } |
47 | 48 |
48 void render() { | 49 void render() { |
49 shadowRoot.children = [ | 50 shadowRoot.children = [ |
50 new NavMenuElement('Observatory', link: '/vm', last: last, | 51 new NavMenuElement('Observatory', link: Uris.vm(), last: last, |
51 queue: _r.queue) | 52 queue: _r.queue) |
52 ..children = [ | 53 ..children = [ |
53 new NavMenuItemElement('Connect to a VM', link: '/vm-connect', | 54 new NavMenuItemElement('Connect to a VM', link: Uris.vmConnect(), |
54 queue: _r.queue), | 55 queue: _r.queue), |
55 new ContentElement() | 56 new ContentElement() |
56 ] | 57 ] |
57 ]; | 58 ]; |
58 } | 59 } |
59 } | 60 } |
OLD | NEW |