1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-28 22:55:39 -04:00

commento.js: undo changes on failed vote

This commit is contained in:
Adhityaa Chandrasekar
2019-03-02 14:30:23 -05:00
parent 295318e6a6
commit a7cd8066f8

View File

@ -977,6 +977,10 @@
post(origin + "/api/comment/vote", json, function(resp) {
if (!resp.success) {
errorShow(resp.message);
classRemove(upvote, "upvoted");
classRemove(downvote, "downvoted");
score.innerText = scorify(parseInt(score.innerText.replace(/[^\d-.]/g, "")) - newDirection + oldDirection);
upDownOnclickSet(upvote, downvote, commentHex, oldDirection);
return;
}
});