Commit df2335c9 by Valera Rozuvan

Bug fixing.

parent 6f16455e
...@@ -42,6 +42,8 @@ PollMain.prototype = { ...@@ -42,6 +42,8 @@ PollMain.prototype = {
_this = this; _this = this;
console.log('submit answer');
answerObj.buttonEl.addClass('answered'); answerObj.buttonEl.addClass('answered');
// Send the data to the server as an AJAX request. Attach a callback that will // Send the data to the server as an AJAX request. Attach a callback that will
...@@ -49,6 +51,9 @@ PollMain.prototype = { ...@@ -49,6 +51,9 @@ PollMain.prototype = {
$.postWithPrefix( $.postWithPrefix(
_this.ajax_url + '/' + answer, {}, _this.ajax_url + '/' + answer, {},
function (response) { function (response) {
console.log('success! response = ');
console.log(response);
_this.showAnswerGraph(response.poll_answers, response.total); _this.showAnswerGraph(response.poll_answers, response.total);
if (_this.canReset === true) { if (_this.canReset === true) {
...@@ -190,7 +195,7 @@ PollMain.prototype = { ...@@ -190,7 +195,7 @@ PollMain.prototype = {
console.log(this.jsonConfig.reset); console.log(this.jsonConfig.reset);
if (this.jsonConfig.reset === "True"){ if ((typeof this.jsonConfig.reset === 'string') && (this.jsonConfig.reset.toLowerCase() === 'true')) {
this.canReset = true; this.canReset = true;
this.resetButton = $('<div class="button reset-button">Reset</div>'); this.resetButton = $('<div class="button reset-button">Reset</div>');
......
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