Poll Plugin: Don't allow voting on closed topics.

This commit is contained in:
Vikhyat Korrapati
2014-03-16 19:18:40 +05:30
parent ae3f135c33
commit 9ef104bbce
4 changed files with 17 additions and 1 deletions
@@ -38,8 +38,14 @@ var PollController = Discourse.Controller.extend({
poll: null,
showResults: false,
disableRadio: Em.computed.any('poll.post.topic.closed', 'loading'),
actions: {
selectOption: function(option) {
if (this.get('disableRadio')) {
return;
}
if (!this.get('currentUser.id')) {
this.get('postController').send('showLogin');
return;