This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/topic-participant.js.es6
2014-09-01 14:23:34 +05:30

19 lines
531 B
JavaScript

export default Ember.Component.extend({
postStream: Em.computed.alias('participant.topic.postStream'),
showPostCount: Em.computed.gte('participant.post_count', 2),
toggled: function() {
return this.get('postStream.userFilters').contains(this.get('participant.username'));
}.property('postStream.userFilters.[]'),
actions: {
toggle: function() {
var postStream = this.get('postStream');
if (postStream) {
postStream.toggleParticipant(this.get('participant.username'));
}
}
}
});