From b4f2ba41be36ed91783a3ee704ef0bb21ba18edd Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Sun, 23 Sep 2018 02:30:00 -0400 Subject: [PATCH] commento.js: sort comments by score by default --- frontend/js/commento.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 06feb0a..89a22e1 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -587,6 +587,10 @@ return null; } + cur.sort(function(a, b) { + return a.score - b.score; + }); + var cards = create("div"); cur.forEach(function(comment) { var commenter = commenters[comment.commenterHex];