From 835c9120532ee284a1700c205cba1c14a47a5e96 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 2 Nov 2017 08:47:51 -0400 Subject: [PATCH] more --- contrib/static/feed.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/contrib/static/feed.js b/contrib/static/feed.js index 6617895..24a0a62 100644 --- a/contrib/static/feed.js +++ b/contrib/static/feed.js @@ -50,8 +50,16 @@ function inject_nntp_feed_element(feed, elem) { var conns = document.createElement("div"); conns.setAttribute("class", "connections"); if (feed.Conns) { - for ( var idx = 0 ; idx < feed.Conns.length; idx ++ ) { - conns.appendChild(createConnectionElement(feed.Conns[idx])); + var conns = feed.Conns; + conns.sort(function(a, b) { + if(a && b) { + if (a.name > b.name) return 1; + else if (a.name < b.name) return -1; + else return 0; + } else return -1; + }); + for ( var idx = 0 ; idx < conns.length; idx ++ ) { + conns.appendChild(createConnectionElement(conns[idx])); } } elem.appendChild(conns);