From df30cb43ec4bce814d6b952ffcb5543a9ff02377 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 6 Aug 2014 13:24:55 +1000 Subject: [PATCH] FIX: reverse insert order when grabbing new topics --- app/assets/javascripts/discourse/models/topic_list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 62983e611d8..4fa07d97795 100644 --- a/app/assets/javascripts/discourse/models/topic_list.js +++ b/app/assets/javascripts/discourse/models/topic_list.js @@ -108,10 +108,12 @@ Discourse.TopicList = Discourse.Model.extend({ Discourse.TopicList.loadTopics(topic_ids, this.get('filter')) .then(function(newTopics){ + var i = 0; topicList.forEachNew(newTopics, function(t) { // highlight the first of the new topics so we can get a visual feedback t.set('highlight', true); - topics.insertAt(0,t); + topics.insertAt(i,t); + i++; }); Discourse.Session.currentProp('topicList', topicList); });