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 NavMenuElement extends HtmlElement implements Renderable { | 10 class NavMenuElement extends HtmlElement implements Renderable { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 super.detached(); _r.disable(notify: true); | 82 super.detached(); _r.disable(notify: true); |
83 shadowRoot.children = []; | 83 shadowRoot.children = []; |
84 } | 84 } |
85 | 85 |
86 void render() { | 86 void render() { |
87 List<Element> children = [ | 87 List<Element> children = [ |
88 _style.clone(true), | 88 _style.clone(true), |
89 new LIElement() | 89 new LIElement() |
90 ..classes = ['nav-menu_label'] | 90 ..classes = ['nav-menu_label'] |
91 ..children = [ | 91 ..children = [ |
92 new AnchorElement(href: '#$link') | 92 new AnchorElement(href: link) |
93 ..text = label, | 93 ..text = label, |
94 new UListElement() | 94 new UListElement() |
95 ..children = [ | 95 ..children = [ |
96 new ContentElement() | 96 new ContentElement() |
97 ] | 97 ] |
98 ] | 98 ] |
99 ]; | 99 ]; |
100 if (!last) { | 100 if (!last) { |
101 children.add( | 101 children.add( |
102 new LIElement() | 102 new LIElement() |
103 ..classes = ['nav-menu_spacer'] | 103 ..classes = ['nav-menu_spacer'] |
104 ..innerHtml = '>' | 104 ..innerHtml = '>' |
105 ); | 105 ); |
106 } | 106 } |
107 shadowRoot.children = children; | 107 shadowRoot.children = children; |
108 } | 108 } |
109 } | 109 } |
OLD | NEW |