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 nav_bar_element; | 5 library nav_bar_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html' hide Notification; | 8 import 'dart:html' hide Notification; |
9 import 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
11 import 'package:observatory/app.dart' show Notification; | 11 import 'package:observatory/app.dart' show Notification; |
12 import 'package:polymer/polymer.dart'; | 12 import 'package:polymer/polymer.dart'; |
13 | 13 |
14 | 14 |
15 @CustomTag('nav-bar') | 15 @CustomTag('nav-bar') |
16 class NavBarElement extends ObservatoryElement { | 16 class NavBarElement extends ObservatoryElement { |
17 @published bool notifyOnPause = true; | 17 @published bool notifyOnPause = true; |
18 @published bool pad = true; | 18 @published bool pad = true; |
19 | 19 |
20 // Desired nav var height in pixels. | 20 // Desired nav var height in pixels. |
21 static const height = 40; | 21 static const height = 40; |
22 | 22 |
23 NavBarElement.created() : super.created(); | 23 NavBarElement.created() : super.created(); |
24 } | 24 } |
25 | 25 |
26 @CustomTag('nav-menu') | |
27 class NavMenuElement extends ObservatoryElement { | |
28 @published String link = '#'; | |
29 @published String anchor = '---'; | |
30 @published bool last = false; | |
31 | |
32 NavMenuElement.created() : super.created(); | |
33 } | |
34 | |
35 @CustomTag('nav-menu-item') | 26 @CustomTag('nav-menu-item') |
36 class NavMenuItemElement extends ObservatoryElement { | 27 class NavMenuItemElement extends ObservatoryElement { |
37 @published String link = '#'; | 28 @published String link = '#'; |
38 @published String anchor = '---'; | 29 @published String anchor = '---'; |
39 | 30 |
40 NavMenuItemElement.created() : super.created(); | 31 NavMenuItemElement.created() : super.created(); |
41 } | 32 } |
42 | 33 |
43 typedef Future RefreshCallback(); | 34 typedef Future RefreshCallback(); |
44 | 35 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 @observable get isUnexpectedError { | 146 @observable get isUnexpectedError { |
156 return (exception is! NetworkRpcException); | 147 return (exception is! NetworkRpcException); |
157 } | 148 } |
158 | 149 |
159 void closeItem(MouseEvent e, var detail, Element target) { | 150 void closeItem(MouseEvent e, var detail, Element target) { |
160 notifications.remove(notification); | 151 notifications.remove(notification); |
161 } | 152 } |
162 | 153 |
163 NavNotifyExceptionElement.created() : super.created(); | 154 NavNotifyExceptionElement.created() : super.created(); |
164 } | 155 } |
OLD | NEW |