From c6113f6701e303b2b12cd6e9f93c0354b99d29be Mon Sep 17 00:00:00 2001 From: James Anderson Date: Sun, 23 Jun 2013 12:12:37 -0700 Subject: [PATCH] Jump to last post in "Best of" mode fix http://meta.discourse.org/t/jump-to-last-post-does-not-work-in-best-of-mode/7626/ --- .../javascripts/discourse/controllers/topic_controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/topic_controller.js b/app/assets/javascripts/discourse/controllers/topic_controller.js index 71773790737..5bcc284a874 100644 --- a/app/assets/javascripts/discourse/controllers/topic_controller.js +++ b/app/assets/javascripts/discourse/controllers/topic_controller.js @@ -135,7 +135,7 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected jumpBottom: function() { if (this.get('bestOf')) { - Discourse.TopicView.scrollTo(this.get('id'), this.get('posts').last().get('post_number')); + Discourse.TopicView.scrollTo(this.get('id'), _.last(this.get('posts')).get('post_number')); } else { Discourse.URL.routeTo(this.get('lastPostUrl')); }