Skip to content

Instantly share code, notes, and snippets.

@nbortolotti
Created February 6, 2015 04:56
Show Gist options
  • Save nbortolotti/9b249ceb70397aa0642a to your computer and use it in GitHub Desktop.
Save nbortolotti/9b249ceb70397aa0642a to your computer and use it in GitHub Desktop.
polymer-element [nick-collapse-viewer]
<polymer-element name="nick-collapse-viewer" attributes="program details link chart image imagedetails">
<template>
<div class="heading" on-click="{{ toggle }}">{{ program }}</div>
<core-collapse id="collapse">
<div class="content">
<div>{{ details }}</div>
<hr size="1" />
<table border="0">
<tr>
<td><img src="{{ image }}" width="100" height="100" /></td>
<td VALIGN="TOP"><div>{{ imagedetails }}</div></td>
</tr>
</table>
<hr size="1" />
<chart-pie
width="150"
height="150"
values="{{ chart | arrayize }}">
</chart-pie>
<div><a href="{{ link }}"> more details</a></div>
</div>
</core-collapse>
</template>
<script>
Polymer('nick-collapse-viewer', {
toggle: function() {
this.$.collapse.toggle();
},
arrayize: function(el) {
return JSON.parse(el);
},
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment