Skip to content

Instantly share code, notes, and snippets.

@dwt
Created September 2, 2010 16:14
Show Gist options
  • Save dwt/562493 to your computer and use it in GitHub Desktop.
Save dwt/562493 to your computer and use it in GitHub Desktop.
hideOrShowDescriptionButton: SC.DisclosureView.design({
tagName: 'div',
layout: { right: 80, top: 14, width: 15, height: 15 },
isVisibleBinding: '*parentView.shouldAllowCollapsingStories',
didChangeValue: function() {
this.get('parentView').didHideOrShowDescription();
}.observes('value')
}),
didHideOrShowDescription: function() {
if (this.getPath('hideOrShowDescriptionButton.value')) {
this.adjust('height', Agilo2.STORY_VIEW_COLLAPSED_HEIGHT);
this.addClass('collapsed');
}
else {
this.adjust('height', Agilo2.STORY_VIEW_EXPANDED_HEIGHT);
this.removeClass('collapsed');
}
}.observes('*hideOrShowDescriptionButton.value'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment