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/service.dart'; | 8 import 'package:observatory/service.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/library_menu.dart'; | 11 import 'package:observatory/src/elements/nav/library_menu.dart'; |
12 | 12 |
| 13 @bindable |
13 class NavLibraryMenuElementWrapper extends HtmlElement { | 14 class NavLibraryMenuElementWrapper extends HtmlElement { |
14 static final binder = new Binder<NavLibraryMenuElementWrapper>( | 15 static const binder = const Binder<NavLibraryMenuElementWrapper>(const { |
15 const [const Binding('last'), const Binding('library')]); | 16 'last': #last, 'library': #library |
| 17 }); |
16 | 18 |
17 static const tag = | 19 static const tag = |
18 const Tag<NavLibraryMenuElementWrapper>('library-nav-menu'); | 20 const Tag<NavLibraryMenuElementWrapper>('library-nav-menu'); |
19 | 21 |
20 bool _last = false; | 22 bool _last = false; |
21 Library _library; | 23 Library _library; |
22 bool get last => _last; | 24 bool get last => _last; |
23 Library get library => _library; | 25 Library get library => _library; |
24 set last(bool value) { | 26 set last(bool value) { |
25 _last = value; render(); | 27 _last = value; render(); |
(...skipping 24 matching lines...) Expand all Loading... |
50 queue: ObservatoryApplication.app.queue) | 52 queue: ObservatoryApplication.app.queue) |
51 ..children = [new ContentElement()] | 53 ..children = [new ContentElement()] |
52 ]; | 54 ]; |
53 } | 55 } |
54 | 56 |
55 bool _getBoolAttribute(String name) { | 57 bool _getBoolAttribute(String name) { |
56 final String value = getAttribute(name); | 58 final String value = getAttribute(name); |
57 return !(value == null || value == 'false'); | 59 return !(value == null || value == 'false'); |
58 } | 60 } |
59 } | 61 } |
OLD | NEW |