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 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/src/elements/helpers/tag.dart'; | 9 import 'package:observatory/src/elements/helpers/tag.dart'; |
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
11 | 11 |
12 class ViewFooterElement extends HtmlElement implements Renderable { | 12 class ViewFooterElement extends HtmlElement implements Renderable { |
13 static const tag = const Tag<ViewFooterElement>('view-footer'); | 13 static const tag = const Tag<ViewFooterElement>('view-footer'); |
14 | 14 |
15 RenderingScheduler _r; | 15 RenderingScheduler _r; |
16 | 16 |
17 Stream<RenderedEvent<ViewFooterElement>> get onRendered => _r.onRendered; | 17 Stream<RenderedEvent<ViewFooterElement>> get onRendered => _r.onRendered; |
18 | 18 |
19 factory ViewFooterElement({RenderingQueue queue}) { | 19 factory ViewFooterElement({RenderingQueue queue}) { |
20 ViewFooterElement e = document.createElement(tag.name); | 20 ViewFooterElement e = document.createElement(tag.name); |
21 e._r = new RenderingScheduler(e, queue: queue); | 21 e._r = new RenderingScheduler(e, queue: queue); |
22 return e; | 22 return e; |
23 } | 23 } |
24 | 24 |
25 ViewFooterElement.created() : super.created() { | 25 ViewFooterElement.created() : super.created(); |
26 // TODO(cbernaschina) remove this when polymer is removed. | |
27 _r = new RenderingScheduler(this); | |
28 } | |
29 | 26 |
30 @override | 27 @override |
31 void attached() { | 28 void attached() { |
32 super.attached(); | 29 super.attached(); |
33 _r.enable(); | 30 _r.enable(); |
34 } | 31 } |
35 | 32 |
36 @override | 33 @override |
37 void detached() { | 34 void detached() { |
38 super.detached(); | 35 super.detached(); |
39 children = []; | 36 children = []; |
40 _r.disable(notify: true); | 37 _r.disable(notify: true); |
41 } | 38 } |
42 | 39 |
43 void render() { | 40 void render() { |
44 children = [ | 41 children = [ |
45 new AnchorElement() | 42 new AnchorElement() |
46 ..href = 'https://www.dartlang.org/tools/observatory' | 43 ..href = 'https://www.dartlang.org/tools/observatory' |
47 ..text = 'View documentation', | 44 ..text = 'View documentation', |
48 new AnchorElement() | 45 new AnchorElement() |
49 ..href = 'https://github.com/dart-lang/sdk/issues/new?title=Observator
y:&body=Observatory%20Feedback' | 46 ..href = 'https://github.com/dart-lang/sdk/issues/new?title=Observator
y:&body=Observatory%20Feedback' |
50 ..text = 'File a bug report' | 47 ..text = 'File a bug report' |
51 ]; | 48 ]; |
52 } | 49 } |
53 } | 50 } |
OLD | NEW |