OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library view_footer_element; | 5 library view_footer_element; |
6 | 6 |
7 import 'package:polymer/polymer.dart'; | 7 import 'dart:html'; |
8 import 'observatory_element.dart'; | 8 import 'helpers/tag.dart'; |
9 | 9 |
10 @CustomTag('view-footer') | 10 class ViewFooterElement extends HtmlElement { |
11 class ViewFooterElement extends ObservatoryElement { | 11 static final StyleElement _style = () { |
12 ViewFooterElement.created() : super.created(); | 12 var style = new StyleElement(); |
| 13 style.text = 'div.view-footer {' |
| 14 ' float: right;' |
| 15 ' padding: 1em;' |
| 16 '}' |
| 17 'div.view-footer a {' |
| 18 ' color: #0489c3;' |
| 19 ' font: 400 14px \'Montserrat\', sans-serif;' |
| 20 ' font-size:90%;' |
| 21 ' text-decoration: none;' |
| 22 '}' |
| 23 'div.view-footer a:hover {' |
| 24 ' text-decoration: underline;' |
| 25 '}'; |
| 26 return style; |
| 27 }(); |
| 28 |
| 29 static const tag = |
| 30 const Tag<ViewFooterElement>('view-footer'); |
| 31 |
| 32 factory ViewFooterElement() { |
| 33 return document.createElement(tag.name); |
| 34 } |
| 35 |
| 36 ViewFooterElement.created() : super.created() { |
| 37 createShadowRoot(); |
| 38 } |
| 39 |
| 40 @override |
| 41 void attached() { |
| 42 super.attached(); |
| 43 render(); |
| 44 } |
| 45 |
| 46 void render() { |
| 47 List<Element> children = <Element>[]; |
| 48 children.add(_style.clone(true)); |
| 49 for (int i = 0; i < 8; ++i) { children.add(new BRElement()); } |
| 50 children.add(new DivElement() |
| 51 ..classes = ['view-footer'] |
| 52 ..children = [ |
| 53 new ParagraphElement() |
| 54 ..children = [ |
| 55 new AnchorElement() |
| 56 ..href = 'https://www.dartlang.org/tools/observatory' |
| 57 ..text = 'View documentation' |
| 58 ], |
| 59 new ParagraphElement() |
| 60 ..children = [ |
| 61 new AnchorElement() |
| 62 ..href = 'https://github.com/dart-lang/sdk/issues/new?title=Observ
atory:&body=Observatory%20Feedback' |
| 63 ..text = 'File a bug report' |
| 64 ] |
| 65 ] |
| 66 ); |
| 67 shadowRoot.children = children; |
| 68 } |
13 } | 69 } |
OLD | NEW |