Skip to content

Instantly share code, notes, and snippets.

@krisselden
Created April 12, 2012 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisselden/2369329 to your computer and use it in GitHub Desktop.
Save krisselden/2369329 to your computer and use it in GitHub Desktop.
Flame.DisclosureView = Flame.LabelView.extend({
classNames: ['flame-disclosure-view'],
buttonExpanded: Flame.image('disclosure_triangle_down.png'),
buttonCollapsed: Flame.image('disclosure_triangle_left.png'),
button: function () {
this.get('visibilityTarget') ? this.get('buttonExpanded') : this.get('buttonCollapsed');
}.property('visibilityTarget', 'buttonExpanded', 'buttonCollapsed'),
handlebars: '<img {{bindAttr src="button"}}> {{value}}',
action: function() {
var value = this.getPath('visibilityTarget');
this.setPath('visibilityTarget', !value);
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment