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 script_ref_element; | 5 library script_ref_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/models.dart' as M show IsolateRef, ScriptRef; | 9 import 'package:observatory/models.dart' as M show IsolateRef, ScriptRef; |
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
(...skipping 23 matching lines...) Expand all Loading... |
34 e._isolate = isolate; | 34 e._isolate = isolate; |
35 e._script = script; | 35 e._script = script; |
36 return e; | 36 return e; |
37 } | 37 } |
38 | 38 |
39 ScriptRefElement.created() : super.created(); | 39 ScriptRefElement.created() : super.created(); |
40 | 40 |
41 @override | 41 @override |
42 void attached() { | 42 void attached() { |
43 super.attached(); | 43 super.attached(); |
44 assert(script != null); | |
45 _r.enable(); | 44 _r.enable(); |
46 } | 45 } |
47 | 46 |
48 @override | 47 @override |
49 void detached() { | 48 void detached() { |
50 super.detached(); | 49 super.detached(); |
51 children = []; | 50 children = []; |
52 _r.disable(notify: true); | 51 _r.disable(notify: true); |
53 } | 52 } |
54 | 53 |
55 void render() { | 54 void render() { |
56 children = [ | 55 children = [ |
57 new AnchorElement(href: Uris.inspect(isolate, object: script)) | 56 new AnchorElement(href: Uris.inspect(isolate, object: script)) |
58 ..title = script.uri | 57 ..title = script.uri |
59 ..text = script.uri.split('/').last | 58 ..text = script.uri.split('/').last |
60 ]; | 59 ]; |
61 } | 60 } |
62 } | 61 } |
OLD | NEW |