discourse/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6

16 lines
467 B
Plaintext
Raw Normal View History

2016-06-07 18:55:01 +08:00
import computed from 'ember-addons/ember-computed-decorators';
import PollVoters from 'discourse/plugins/poll/components/poll-voters';
export default PollVoters.extend({
2016-06-09 21:33:17 +08:00
@computed("poll.voters", "pollsVoters")
canLoadMore(voters, pollsVoters) {
return pollsVoters.length < voters;
2016-06-07 18:55:01 +08:00
},
2016-06-09 21:33:17 +08:00
@computed("poll.options", "offset")
voterIds(options) {
const ids = [].concat(...(options.map(option => option.voter_ids)));
return this._getIds(ids);
2016-06-07 18:55:01 +08:00
}
});