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 import 'dart:html'; | 5 import 'dart:html'; |
6 | 6 |
7 import 'package:observatory/app.dart'; | 7 import 'package:observatory/app.dart'; |
8 import 'package:observatory/repositories.dart'; | 8 import 'package:observatory/repositories.dart'; |
9 import 'package:observatory/src/elements/helpers/tag.dart'; | 9 import 'package:observatory/src/elements/helpers/tag.dart'; |
10 import 'package:observatory/src/elements/shims/binding.dart'; | 10 import 'package:observatory/src/elements/shims/binding.dart'; |
11 import 'package:observatory/src/elements/nav/notify.dart'; | 11 import 'package:observatory/src/elements/nav/notify.dart'; |
12 | 12 |
| 13 @bindable |
13 class NavNotifyElementWrapper extends HtmlElement { | 14 class NavNotifyElementWrapper extends HtmlElement { |
14 static final binder = new Binder<NavNotifyElementWrapper>( | 15 static const binder = const Binder<NavNotifyElementWrapper>(const { |
15 const [const Binding('notifications'), const Binding('notifyOnPause')]); | 16 'notifications': #notifications, 'notifyOnPause': #notifyOnPause |
| 17 }); |
16 | 18 |
17 static const tag = const Tag<NavNotifyElementWrapper>('nav-notify'); | 19 static const tag = const Tag<NavNotifyElementWrapper>('nav-notify'); |
18 | 20 |
19 NotificationRepository _notifications; | 21 NotificationRepository _notifications; |
20 bool _notifyOnPause = true; | 22 bool _notifyOnPause = true; |
21 NotificationRepository get notifications => _notifications; | 23 NotificationRepository get notifications => _notifications; |
22 bool get notifyOnPause => _notifyOnPause; | 24 bool get notifyOnPause => _notifyOnPause; |
23 set notifications(NotificationRepository value) { | 25 set notifications(NotificationRepository value) { |
24 _notifications = value; render(); | 26 _notifications = value; render(); |
25 } | 27 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 116 } |
115 | 117 |
116 nav-exception > div > button:hover, nav-event > div > button:hover { | 118 nav-exception > div > button:hover, nav-event > div > button:hover { |
117 background: rgba(255,255,255,0.5); | 119 background: rgba(255,255,255,0.5); |
118 }''', | 120 }''', |
119 new NavNotifyElement(_notifications, notifyOnPause: notifyOnPause, | 121 new NavNotifyElement(_notifications, notifyOnPause: notifyOnPause, |
120 queue: ObservatoryApplication.app.queue) | 122 queue: ObservatoryApplication.app.queue) |
121 ]; | 123 ]; |
122 } | 124 } |
123 } | 125 } |
OLD | NEW |