Commit 5a62eae7 by Valera Rozuvan

Fixing bugs.

parent 653154f1
......@@ -51,7 +51,9 @@ PollMain.prototype = {
function (response) {
_this.showAnswerGraph(response.poll_answers, response.total);
_this.resetButton.show();
if (_this.canReset === true) {
_this.resetButton.show();
}
// Initialize Conditional constructors.
if (_this.wrapperSectionEl !== null) {
......@@ -62,7 +64,6 @@ PollMain.prototype = {
}
);
}, // End-of: 'submitAnswer': function (answer, answerEl) {
......@@ -187,7 +188,11 @@ PollMain.prototype = {
}
});
console.log(this.jsonConfig.reset);
if (this.jsonConfig.reset === "True"){
this.canReset = true;
this.resetButton = $('<div class="button reset-button">Reset</div>');
if (this.questionAnswered === false) {
......@@ -199,6 +204,8 @@ PollMain.prototype = {
this.resetButton.on('click', function () {
_this.submitReset();
});
} else {
this.canReset = false;
}
// If it turns out that the user already answered the question, show the answers graph.
......
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