Created
April 12, 2012 17:23
-
-
Save krisselden/2369329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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