bug fixed: was trying to remove an unexisting span.votes

This commit is contained in:
Théo Zimmermann 2014-10-17 09:24:53 +02:00
parent 74363d44ba
commit d0a0ac39b0

View File

@ -155,8 +155,10 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n",
// update vote counter, but hide if votes sum to 0
var votes = function (value) {
var span = $("span.votes", footer);
if (span === null && value !== 0) {
footer.prepend($.new("span.votes", value));
if (span === null) {
if (value !== 0) {
footer.prepend($.new("span.votes", value));
}
} else {
if (value === 0) {
span.remove();