Merge pull request #130 from Zimmi48/master

bug fixed: was trying to remove an unexisting span.votes
This commit is contained in:
Martin Zimmermann 2014-10-20 15:11:50 +02:00
commit b800a8bbe7

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) {
if (span === null) {
if (value !== 0) {
footer.prepend($.new("span.votes", value));
}
} else {
if (value === 0) {
span.remove();