Hiding zero votes is now done through CSS instead of javascript.

pull/260/head
Ivan Pantic 8 years ago
parent b620f2c0b0
commit b0f8606b0f

@ -145,6 +145,9 @@
.isso-comment .isso-postbox {
margin-top: 0.8em;
}
.isso-comment.isso-no-votes span.votes {
display: none;
}
.isso-postbox {
max-width: 68em;

@ -165,19 +165,18 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n",
);
if (config.vote) {
// update vote counter, but hide if votes sum to 0
// update vote counter
var votes = function (value) {
var span = $("span.votes", footer);
if (span === null) {
if (value !== 0) {
footer.prepend($.new("span.votes", value));
}
footer.prepend($.new("span.votes", value));
} else {
if (value === 0) {
span.remove();
} else {
span.textContent = value;
}
span.textContent = value;
}
if (value) {
el.classList.remove('isso-no-votes');
} else {
el.classList.add('isso-no-votes');
}
};
@ -192,6 +191,8 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n",
votes(rv.likes - rv.dislikes);
});
});
votes(comment.likes - comment.dislikes);
}
$("a.edit", footer).toggle("click",

@ -24,8 +24,6 @@ div(class='isso-comment' id='isso-#{comment.id}')
div(class='isso-comment-footer')
if conf.vote
if comment.likes - comment.dislikes != 0
span(class='votes') #{comment.likes - comment.dislikes}
a(class='upvote' href='#')
!= svg['arrow-up']
span(class='spacer') |

Loading…
Cancel
Save