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/tag.dart'; | 7 import 'package:observatory/src/elements/helpers/tag.dart'; |
8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
9 | 9 |
10 class NavMenuItemElement extends HtmlElement implements Renderable { | 10 class NavMenuItemElement extends HtmlElement implements Renderable { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 super.detached(); _r.disable(notify: true); | 81 super.detached(); _r.disable(notify: true); |
82 shadowRoot.children = []; | 82 shadowRoot.children = []; |
83 } | 83 } |
84 | 84 |
85 void render() { | 85 void render() { |
86 shadowRoot.children = [ | 86 shadowRoot.children = [ |
87 _style.clone(true), | 87 _style.clone(true), |
88 new LIElement() | 88 new LIElement() |
89 ..classes = ['nav-menu-item'] | 89 ..classes = ['nav-menu-item'] |
90 ..children = [ | 90 ..children = [ |
91 new AnchorElement(href: '#$link') | 91 new AnchorElement(href: link) |
92 ..text = label, | 92 ..text = label, |
93 new UListElement() | 93 new UListElement() |
94 ..children = [ | 94 ..children = [ |
95 new ContentElement() | 95 new ContentElement() |
96 ] | 96 ] |
97 ] | 97 ] |
98 ]; | 98 ]; |
99 } | 99 } |
100 } | 100 } |
OLD | NEW |