Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
shuttle: use resolvePath for favorite icon
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Oct 29, 2013
1 parent 9f06314 commit e14f937
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shiny/Shuttle-v2/shuttle-toggle-icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@

<link rel="import" href="../../../polymer-ui-elements/polymer-ui-icon/polymer-ui-icon.html">

<polymer-element name="shuttle-toggle-icon" attributes="src icon active activeSrc activeIcon" on-tap="{{toggle}}">
<polymer-element name="shuttle-toggle-icon" attributes="active src activeSrc" on-tap="{{toggle}}">
<template>
<polymer-ui-icon src="{{active ? activeSrc : src}}" icon="{{active ? activeIcon : icon}}"></polymer-ui-icon>
<polymer-ui-icon id="icon"></polymer-ui-icon>
</template>
<script>
Polymer('shuttle-toggle-icon', {
active: false,
ready: function() {
this.activeChanged();
},
activeChanged: function() {
this.$.icon.src = this.resolvePath(this.active ? this.activeSrc : this.src);
},
toggle: function() {
this.active = !this.active;
}
Expand Down

0 comments on commit e14f937

Please sign in to comment.