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 code_view_element; | 5 library code_view_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
9 import 'package:observatory/service.dart'; | 9 import 'package:observatory/service.dart'; |
10 import 'package:polymer/polymer.dart'; | 10 import 'package:polymer/polymer.dart'; |
11 | 11 |
12 @CustomTag('code-view') | 12 @CustomTag('code-view') |
13 class CodeViewElement extends ObservatoryElement { | 13 class CodeViewElement extends ObservatoryElement { |
14 @published Code code; | 14 @published Code code; |
15 CodeViewElement.created() : super.created(); | 15 CodeViewElement.created() : super.created(); |
16 | 16 |
17 void enteredView() { | 17 @override |
18 super.enteredView(); | 18 void attached() { |
| 19 super.attached(); |
19 if (code == null) { | 20 if (code == null) { |
20 return; | 21 return; |
21 } | 22 } |
22 code.load().then((Code c) { | 23 code.load().then((Code c) { |
23 c.loadScript(); | 24 c.loadScript(); |
24 }); | 25 }); |
25 } | 26 } |
26 | 27 |
27 void refresh(var done) { | 28 void refresh(var done) { |
28 code.reload().whenComplete(done); | 29 code.reload().whenComplete(done); |
(...skipping 21 matching lines...) Expand all Loading... |
50 } | 51 } |
51 | 52 |
52 void mouseOut(Event e, var detail, Node target) { | 53 void mouseOut(Event e, var detail, Node target) { |
53 var jt = _findJumpTarget(target); | 54 var jt = _findJumpTarget(target); |
54 if (jt == null) { | 55 if (jt == null) { |
55 return; | 56 return; |
56 } | 57 } |
57 jt.classes.remove('highlight'); | 58 jt.classes.remove('highlight'); |
58 } | 59 } |
59 } | 60 } |
OLD | NEW |