Commit 99f7667a by Jonathan Piacenti

Fixed Javascript scoping issues and missing return statement in vote.

parent c3d895c4
......@@ -385,6 +385,7 @@ class PollBlock(PollBase):
if not self.can_vote():
result['errors'].append('You have already voted as many times as you are allowed.')
return result
self.clean_tally()
if old_choice is not None:
......
......@@ -16,7 +16,9 @@ function PollUtil (runtime, element, pollType) {
self.getResults({'success': true});
return false;
}
if (parseInt($('.poll-max-submissions').text()) > 1 && parseInt($('.poll-current-count').text()) > 0) {
var max_submissions = parseInt($('.poll-max-submissions', element).text());
var current_count = parseInt($('.poll-current-count', element).text());
if (max_submissions > 1 && current_count > 0) {
$('.poll-submissions-count', element).show();
}
return true;
......@@ -117,7 +119,7 @@ function PollUtil (runtime, element, pollType) {
var can_vote = data['can_vote'];
$('.poll-current-count', element).text(data['submissions_count']);
if (data['max_submissions'] > 1) {
$('.poll-submissions-count').show();
$('.poll-submissions-count', element).show();
}
if ($('div.poll-block', element).data('private')) {
// User may be changing their vote. Give visual feedback that it was accepted.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment