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 observatory_element; | 5 library observatory_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/app.dart'; | 9 import 'package:observatory/app.dart'; |
10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
11 import 'package:polymer/polymer.dart'; | 11 import 'package:polymer/polymer.dart'; |
12 | 12 |
13 /// Base class for all Observatory custom elements. | 13 /// Base class for all Observatory custom elements. |
14 @CustomTag('observatory-element') | 14 @CustomTag('observatory-element') |
15 class ObservatoryElement extends PolymerElement { | 15 class ObservatoryElement extends PolymerElement { |
16 ObservatoryElement.created() : super.created(); | 16 ObservatoryElement.created() : super.created(); |
17 | 17 |
18 ObservatoryApplication get app => ObservatoryApplication.app; | 18 ObservatoryApplication get app => ObservatoryApplication.app; |
19 Page get page => app.currentPage; | 19 Page get page => app.currentPage; |
20 ObservableMap get args => page.args; | |
21 | 20 |
22 @override | 21 @override |
23 void attached() { | 22 void attached() { |
24 super.attached(); | 23 super.attached(); |
25 _startPoll(); | 24 _startPoll(); |
26 } | 25 } |
27 | 26 |
28 @override | 27 @override |
29 void attributeChanged(String name, var oldValue, var newValue) { | 28 void attributeChanged(String name, var oldValue, var newValue) { |
30 super.attributeChanged(name, oldValue, newValue); | 29 super.attributeChanged(name, oldValue, newValue); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 var anchorElement = new AnchorElement(); | 187 var anchorElement = new AnchorElement(); |
189 anchorElement.href = href; | 188 anchorElement.href = href; |
190 anchorElement.text = label; | 189 anchorElement.text = label; |
191 if (title != null) { | 190 if (title != null) { |
192 anchorElement.title = title; | 191 anchorElement.title = title; |
193 } | 192 } |
194 anchorElement.onClick.listen(onClickGoto); | 193 anchorElement.onClick.listen(onClickGoto); |
195 shadowRoot.children.add(anchorElement); | 194 shadowRoot.children.add(anchorElement); |
196 } | 195 } |
197 } | 196 } |
OLD | NEW |