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 function_ref_element; | 5 library function_ref_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
9 import 'package:observatory/service.dart'; | 9 import 'package:observatory/service.dart'; |
10 import 'service_ref.dart'; | 10 import 'service_ref.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 ServiceFunction get function => ref; | 23 ServiceFunction get function => ref; |
24 void _updateShadowDom() { | 24 void _updateShadowDom() { |
25 clearShadowRoot(); | 25 clearShadowRoot(); |
26 if (ref == null) { | 26 if (ref == null) { |
27 return; | 27 return; |
28 } | 28 } |
29 if (function.isDart) { | 29 if (function.isDart) { |
30 if (qualified) { | 30 if (qualified) { |
31 // Add class-name or parent-function-name followed by a dot. | 31 if (function.dartOwner is ServiceFunction) { |
32 if ((function.parent == null) && (function.owningClass != null)) { | |
33 var classRef = new Element.tag('class-ref'); | |
34 classRef.ref = function.owningClass; | |
35 shadowRoot.children.add(classRef); | |
36 insertTextSpanIntoShadowRoot('.'); | |
37 } else if (function.parent != null) { | |
38 var functionRef = new Element.tag('function-ref'); | 32 var functionRef = new Element.tag('function-ref'); |
39 functionRef.ref = function.parent; | 33 functionRef.ref = function.dartOwner; |
40 functionRef.qualified = true; | 34 functionRef.qualified = true; |
41 shadowRoot.children.add(functionRef); | 35 shadowRoot.children.add(functionRef); |
42 insertTextSpanIntoShadowRoot('.'); | 36 insertTextSpanIntoShadowRoot('.'); |
| 37 } else if (function.dartOwner is Class) { |
| 38 var classRef = new Element.tag('class-ref'); |
| 39 classRef.ref = function.dartOwner; |
| 40 shadowRoot.children.add(classRef); |
| 41 insertTextSpanIntoShadowRoot('.'); |
43 } | 42 } |
44 } | 43 } |
45 insertLinkIntoShadowRoot(name, url, hoverText); | 44 insertLinkIntoShadowRoot(name, url, hoverText); |
46 } else { | 45 } else { |
47 insertTextSpanIntoShadowRoot(name); | 46 insertTextSpanIntoShadowRoot(name); |
48 } | 47 } |
49 } | 48 } |
50 } | 49 } |
OLD | NEW |