OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 flag_list_element; | 5 library flag_list_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/nav_bar.dart'; |
11 import 'package:observatory/src/elements/helpers/nav_menu.dart'; | 11 import 'package:observatory/src/elements/helpers/nav_menu.dart'; |
12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
13 import 'package:observatory/src/elements/helpers/tag.dart'; | 13 import 'package:observatory/src/elements/helpers/tag.dart'; |
| 14 import 'package:observatory/src/elements/helpers/uris.dart'; |
14 import 'package:observatory/src/elements/nav/notify.dart'; | 15 import 'package:observatory/src/elements/nav/notify.dart'; |
15 import 'package:observatory/src/elements/nav/refresh.dart'; | 16 import 'package:observatory/src/elements/nav/refresh.dart'; |
16 import 'package:observatory/src/elements/nav/top_menu.dart'; | 17 import 'package:observatory/src/elements/nav/top_menu.dart'; |
17 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 18 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
18 import 'package:observatory/src/elements/view_footer.dart'; | 19 import 'package:observatory/src/elements/view_footer.dart'; |
19 | 20 |
20 class FlagListElement extends HtmlElement implements Renderable { | 21 class FlagListElement extends HtmlElement implements Renderable { |
21 static const tag = | 22 static const tag = |
22 const Tag<FlagListElement>('flag-list', dependencies: const [ | 23 const Tag<FlagListElement>('flag-list', dependencies: const [ |
23 NavNotifyElement.tag, | 24 NavNotifyElement.tag, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 content.add(new HeadingElement.h2()..text = 'None'); | 94 content.add(new HeadingElement.h2()..text = 'None'); |
94 } else { | 95 } else { |
95 content.addAll(unmodified.expand(_renderFlag)); | 96 content.addAll(unmodified.expand(_renderFlag)); |
96 } | 97 } |
97 } | 98 } |
98 | 99 |
99 children = [ | 100 children = [ |
100 navBar([ | 101 navBar([ |
101 new NavTopMenuElement(queue: _r.queue), | 102 new NavTopMenuElement(queue: _r.queue), |
102 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 103 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
103 navMenu('flags'), | 104 navMenu('flags', link: Uris.flags()), |
104 new NavRefreshElement(queue: _r.queue) | 105 new NavRefreshElement(queue: _r.queue) |
105 ..onRefresh.listen((e) async { | 106 ..onRefresh.listen((e) async { |
106 e.element.disabled = true; | 107 e.element.disabled = true; |
107 try { | 108 try { |
108 await _refresh(); | 109 await _refresh(); |
109 } finally { | 110 } finally { |
110 e.element.disabled = false; | 111 e.element.disabled = false; |
111 } | 112 } |
112 }), | 113 }), |
113 new NavNotifyElement(_notifications, queue: _r.queue) | 114 new NavNotifyElement(_notifications, queue: _r.queue) |
(...skipping 29 matching lines...) Expand all Loading... |
143 ..text = flag.name, | 144 ..text = flag.name, |
144 new SpanElement()..text = '=', | 145 new SpanElement()..text = '=', |
145 new SpanElement() | 146 new SpanElement() |
146 ..classes = ['value'] | 147 ..classes = ['value'] |
147 ..text = flag.valueAsString ?? 'NULL' | 148 ..text = flag.valueAsString ?? 'NULL' |
148 ], | 149 ], |
149 new BRElement(), | 150 new BRElement(), |
150 ]; | 151 ]; |
151 } | 152 } |
152 } | 153 } |
OLD | NEW |