| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 timeline_page_element; | 5 library timeline_page_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
| 11 import 'package:observatory/elements.dart'; |
| 11 import 'package:observatory/service_html.dart'; | 12 import 'package:observatory/service_html.dart'; |
| 12 import 'package:polymer/polymer.dart'; | 13 import 'package:polymer/polymer.dart'; |
| 13 | 14 |
| 14 | 15 |
| 15 @CustomTag('timeline-page') | 16 @CustomTag('timeline-page') |
| 16 class TimelinePageElement extends ObservatoryElement { | 17 class TimelinePageElement extends ObservatoryElement { |
| 17 TimelinePageElement.created() : super.created(); | 18 TimelinePageElement.created() : super.created(); |
| 18 | 19 |
| 19 attached() { | 20 attached() { |
| 20 super.attached(); | 21 super.attached(); |
| 21 _resizeSubscription = window.onResize.listen((_) => _updateSize()); | 22 _resizeSubscription = window.onResize.listen((_) => _updateSize()); |
| 22 _updateSize(); | 23 _updateSize(); |
| 24 // Click refresh button. |
| 25 NavRefreshElement refreshButton = $['refresh']; |
| 26 refreshButton.buttonClick(null, null, null); |
| 23 } | 27 } |
| 24 | 28 |
| 25 detached() { | 29 detached() { |
| 26 super.detached(); | 30 super.detached(); |
| 27 if (_resizeSubscription != null) { | 31 if (_resizeSubscription != null) { |
| 28 _resizeSubscription.cancel(); | 32 _resizeSubscription.cancel(); |
| 29 } | 33 } |
| 30 } | 34 } |
| 31 | 35 |
| 32 Future postMessage(String method) { | 36 Future postMessage(String method) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 final top = e.offset.top; | 87 final top = e.offset.top; |
| 84 final bottomMargin = 32; | 88 final bottomMargin = 32; |
| 85 final mainHeight = totalHeight - top - bottomMargin; | 89 final mainHeight = totalHeight - top - bottomMargin; |
| 86 e.style.setProperty('height', '${mainHeight}px'); | 90 e.style.setProperty('height', '${mainHeight}px'); |
| 87 e.style.setProperty('width', '100%'); | 91 e.style.setProperty('width', '100%'); |
| 88 } | 92 } |
| 89 | 93 |
| 90 | 94 |
| 91 StreamSubscription _resizeSubscription; | 95 StreamSubscription _resizeSubscription; |
| 92 } | 96 } |
| OLD | NEW |