| // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| |
| import 'dart:html'; |
| |
| navMenu(String label, {String? link, List<Element> content: const []}) { |
| assert(label != null); |
| assert(content != null); |
| return new LIElement() |
| ..classes = ['nav-menu'] |
| ..children = <Element>[ |
| new SpanElement() |
| ..classes = ['nav-menu_label'] |
| ..children = <Element>[ |
| new AnchorElement(href: link)..text = label, |
| new UListElement()..children = content |
| ] |
| ]; |
| } |