http://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153
24 lines
624 B
JavaScript
24 lines
624 B
JavaScript
(function() {
|
|
|
|
window.Discourse.RepliesView = Ember.CollectionView.extend({
|
|
templateName: 'replies',
|
|
tagName: 'section',
|
|
classNames: ['replies-list', 'embedded-posts', 'bottom'],
|
|
itemViewClass: Discourse.EmbeddedPostView,
|
|
repliesShown: (function() {
|
|
var $this;
|
|
$this = this.$();
|
|
if (this.get('parentView.repliesShown')) {
|
|
return Em.run.next(function() {
|
|
return $this.slideDown();
|
|
});
|
|
} else {
|
|
return Em.run.next(function() {
|
|
return $this.slideUp();
|
|
});
|
|
}
|
|
}).observes('parentView.repliesShown')
|
|
});
|
|
|
|
}).call(this);
|