Index: runtime/observatory/lib/src/elements/observatory_element.dart |
diff --git a/runtime/observatory/lib/src/elements/observatory_element.dart b/runtime/observatory/lib/src/elements/observatory_element.dart |
index 9e9a363d7f0f0e4ac61ab68d212c94b27a37144a..c0103a5bedc4a40e64797fb6a166834acf3f5f75 100644 |
--- a/runtime/observatory/lib/src/elements/observatory_element.dart |
+++ b/runtime/observatory/lib/src/elements/observatory_element.dart |
@@ -88,7 +88,12 @@ class ObservatoryElement extends PolymerElement { |
/// Utility method for handling on-click of <a> tags. Navigates |
/// within the application using the [LocationManager]. |
void goto(MouseEvent event, var detail, Element target) { |
- app.locationManager.onGoto(event, detail, target); |
+ app.locationManager.onGoto(event); |
+ event.stopPropagation(); |
+ } |
+ |
+ void onClickGoto(MouseEvent event) { |
+ app.locationManager.onGoto(event); |
event.stopPropagation(); |
} |
@@ -97,8 +102,12 @@ class ObservatoryElement extends PolymerElement { |
if (obj is Isolate) { |
url = '${url}?isolateId=${Uri.encodeComponent(obj.id)}'; |
} else { |
+ if (obj.id == null) { |
+ // No id |
+ return url; |
+ } |
url = ('${url}?isolateId=${Uri.encodeComponent(obj.isolate.id)}' |
- '&objectId=${Uri.encodeComponent(obj.id)}'); |
+ '&objectId=${Uri.encodeComponent(obj.id)}'); |
} |
} |
return url; |
@@ -151,4 +160,26 @@ class ObservatoryElement extends PolymerElement { |
} |
return new String.fromCharCodes(result); |
} |
+ |
+ void clearShadowRoot() { |
+ // Remove all non-style elements. |
+ shadowRoot.children.removeWhere((e) => e is! StyleElement); |
+ } |
+ |
+ void insertTextSpanIntoShadowRoot(String text) { |
+ var spanElement = new SpanElement(); |
+ spanElement.text = text; |
+ shadowRoot.children.add(spanElement); |
+ } |
+ |
+ void insertLinkIntoShadowRoot(String label, String href, [String title]) { |
+ var anchorElement = new AnchorElement(); |
+ anchorElement.href = href; |
+ anchorElement.text = label; |
+ if (title != null) { |
+ anchorElement.title = title; |
+ } |
+ anchorElement.onClick.listen(onClickGoto); |
+ shadowRoot.children.add(anchorElement); |
+ } |
} |