FIX: clicking "show results" wasn't working after casting a vote

This commit is contained in:
Régis Hanol 2015-04-24 17:24:13 +02:00
parent eff921d1ec
commit 8129cce104
2 changed files with 4 additions and 5 deletions

View File

@ -77,9 +77,7 @@ export default Em.Controller.extend({
}.property("min", "max", "poll.options.length"),
canCastVotes: function() {
if (this.get("isClosed") ||
this.get("showingResults") ||
this.get("loading")) {
if (this.get("isClosed") || this.get("showingResults") || this.get("loading")) {
return false;
}
@ -137,7 +135,7 @@ export default Em.Controller.extend({
options: this.get("selectedOptions"),
}
}).then(function(results) {
self.setProperties({ vote: results.vote, showingResults: true });
self.setProperties({ vote: results.vote, showResults: true });
self.set("model", Em.Object.create(results.poll));
}).catch(function() {
bootbox.alert(I18n.t("poll.error_while_casting_votes"));

View File

@ -68,6 +68,8 @@ div.poll {
.results {
width: 100%;
.option {
max-width: 90%;
padding-right: 1.6em;
@ -88,7 +90,6 @@ div.poll {
.bar {
height: 10px;
background: $primary;
transition: all 0.25s;
}
}