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 library general_error_element; | 5 library general_error_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
| 10 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
10 import 'package:observatory/src/elements/helpers/tag.dart'; | 11 import 'package:observatory/src/elements/helpers/tag.dart'; |
11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
12 import 'package:observatory/src/elements/nav/bar.dart'; | |
13 import 'package:observatory/src/elements/nav/notify.dart'; | 13 import 'package:observatory/src/elements/nav/notify.dart'; |
14 import 'package:observatory/src/elements/nav/top_menu.dart'; | 14 import 'package:observatory/src/elements/nav/top_menu.dart'; |
15 | 15 |
16 class GeneralErrorElement extends HtmlElement implements Renderable { | 16 class GeneralErrorElement extends HtmlElement implements Renderable { |
17 static const tag = const Tag<GeneralErrorElement>('general-error', | 17 static const tag = const Tag<GeneralErrorElement>('general-error', |
18 dependencies: const [NavBarElement.tag, | 18 dependencies: const [NavTopMenuElement.tag, |
19 NavTopMenuElement.tag, | |
20 NavNotifyElement.tag]); | 19 NavNotifyElement.tag]); |
21 | 20 |
22 RenderingScheduler _r; | 21 RenderingScheduler _r; |
23 | 22 |
24 Stream<RenderedEvent<GeneralErrorElement>> get onRendered => _r.onRendered; | 23 Stream<RenderedEvent<GeneralErrorElement>> get onRendered => _r.onRendered; |
25 | 24 |
26 M.NotificationRepository _notifications; | 25 M.NotificationRepository _notifications; |
27 String _message; | 26 String _message; |
28 | 27 |
29 String get message => _message; | 28 String get message => _message; |
(...skipping 22 matching lines...) Expand all Loading... |
52 | 51 |
53 @override | 52 @override |
54 void detached() { | 53 void detached() { |
55 super.detached(); | 54 super.detached(); |
56 children = []; | 55 children = []; |
57 _r.disable(notify: true); | 56 _r.disable(notify: true); |
58 } | 57 } |
59 | 58 |
60 void render() { | 59 void render() { |
61 children = [ | 60 children = [ |
62 new NavBarElement(queue: _r.queue) | 61 navBar([ |
63 ..children = [ | 62 new NavTopMenuElement(queue: _r.queue), |
64 new NavTopMenuElement(last: true, queue: _r.queue), | 63 new NavNotifyElement(_notifications, queue: _r.queue) |
65 new NavNotifyElement(_notifications, queue: _r.queue) | 64 ]), |
66 ], | |
67 new DivElement()..classes = ['content-centered'] | 65 new DivElement()..classes = ['content-centered'] |
68 ..children = [ | 66 ..children = [ |
69 new HeadingElement.h1()..text = 'Error', | 67 new HeadingElement.h1()..text = 'Error', |
70 new BRElement(), | 68 new BRElement(), |
71 new DivElement()..classes = ['well'] | 69 new DivElement()..classes = ['well'] |
72 ..text = message | 70 ..text = message |
73 ] | 71 ] |
74 ]; | 72 ]; |
75 } | 73 } |
76 } | 74 } |
OLD | NEW |