Chromium Code Reviews| Index: runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html |
| diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html |
| index ecf3f0679d06e0b9bf881dffbab97d6f85ff9e9a..bfd8ca19aaf7806a59fc4134d1f0ff67d8cd76f4 100644 |
| --- a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html |
| +++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html |
| @@ -1,20 +1,71 @@ |
| <head> |
| -<link rel="import" href="observatory_element.html"> |
| -<link rel="import" href="service_ref.html"> |
| + <link rel="import" href="observatory_element.html"> |
| + <link rel="import" href="service_ref.html"> |
| </head> |
| <polymer-element name="instance-ref" extends="service-ref"> |
| -<template> |
| -<div> |
| - <template if="{{ (ref['type'] == 'null') }}"> |
| - unexpected null |
| + <template> |
| + <style> |
| + .memberList { |
| + margin-left: 3em; |
| + border-spacing: 0; |
| + border-collapse: collapse; |
| + } |
| + .member { |
| + vertical-align: top; |
| + padding: 0 1em; |
| + } |
| + </style> |
| + <div> |
| + <template if="{{ (ref['type'] == 'null') }}"> |
| + unexpected null |
| + </template> |
| + |
| + <template if="{{ (ref['type'] == '@Null') }}"> |
| + {{ name }} |
| + </template> |
| + |
| + <template if="{{ (ref['type'] == '@String' || |
| + ref['type'] == '@Bool' || |
| + ref['type'] == '@Smi' || |
| + ref['type'] == '@Mint') }}"> |
| + <a href="{{ url }}">{{ name }}</a> |
| + </template> |
| + |
| + <template if="{{ (ref['type'] == '@Instance') }}"> |
| + <a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em></a> { |
| + <a on-click="{{ toggleExpand }}">...</a> |
| + <template if="{{ expanded }}"> |
| + <table class="memberList"> |
| + <tr template repeat="{{ field in ref['fields'] }}"> |
| + |
| + <td class="member">{{ field['decl']['user_name'] }}</td> |
| + <td class="member"> |
| + <instance-ref app="{{ app }}" ref="{{ field['value'] }}"></instance-ref> |
| + </td> |
| + </tr> |
| + </table> |
| + </template> |
| + } |
| + </template> |
| + |
| + <template if="{{ (ref['type'] == '@GrowableObjectArray' || |
| + ref['type'] == '@Array') }}"> |
|
Cutch
2014/02/13 22:31:29
Add a static method somewhere for these type check
turnidge
2014/02/14 17:36:47
Done-ish. Because we dwell in the land of polymer
|
| + <a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em> ({{ ref['length']}})</a> { |
| + <a on-click="{{ toggleExpand }}">...</a> |
| + <template if="{{ expanded }}"> |
| + <table class="memberList"> |
| + <tr template repeat="{{ element in ref['elements'] }}"> |
| + <td class="member">[{{ element['index']}}]</td> |
| + <td class="member"> |
| + <instance-ref app="{{ app }}" ref="{{ element['value'] }}"></instance-ref> |
| + </td> |
| + </tr> |
| + </table> |
| + </template> |
| + } |
| + </template> |
| + |
| + </div> |
| </template> |
| - <template if="{{ (ref['type'] == '@Null') }}"> |
| - {{ name }} |
| - </template> |
| - <template if="{{ (ref['type'] != 'null') && ref['type'] != '@Null' }}"> |
| - <a href="{{ url }}">{{ name }} </a> |
| - </template> |
| - </div> |
| -</template> |
| -<script type="application/dart" src="instance_ref.dart"></script> |
| + <script type="application/dart" src="instance_ref.dart"></script> |
| </polymer-element> |