diff --git a/app/assets/javascripts/discourse/controllers/topic_controller.js b/app/assets/javascripts/discourse/controllers/topic_controller.js index 1f942a618f9..041e33ab08f 100644 --- a/app/assets/javascripts/discourse/controllers/topic_controller.js +++ b/app/assets/javascripts/discourse/controllers/topic_controller.js @@ -90,7 +90,7 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected }, selectAll: function() { - var posts = this.get('posts'); + var posts = this.get('postStream.posts'); var selectedPosts = this.get('selectedPosts'); if (posts) { selectedPosts.addObjects(posts); diff --git a/app/assets/javascripts/discourse/models/topic.js b/app/assets/javascripts/discourse/models/topic.js index 6bfdbe89ee2..2d7dddd3d39 100644 --- a/app/assets/javascripts/discourse/models/topic.js +++ b/app/assets/javascripts/discourse/models/topic.js @@ -79,26 +79,6 @@ Discourse.Topic = Discourse.Model.extend({ return this.urlForPostNumber(this.get('highest_post_number')); }.property('url', 'highest_post_number'), - // The last post in the topic - lastPost: function() { - var posts = this.get('posts'); - return posts[posts.length-1]; - }, - - postsChanged: function() { - var last, posts; - posts = this.get('posts'); - last = posts[posts.length - 1]; - if (!(last && last.set && !last.lastPost)) return; - _.each(posts,function(p) { - if (p.lastPost) { - p.set('lastPost', false); - } - }); - last.set('lastPost', true); - return true; - }.observes('posts.@each', 'posts'), - // The amount of new posts to display. It might be different than what the server // tells us if we are still asynchronously flushing our "recently read" data. // So take what the browser has seen into consideration. diff --git a/app/assets/javascripts/discourse/views/post_view.js b/app/assets/javascripts/discourse/views/post_view.js index 6f374f332ce..56e88d76175 100644 --- a/app/assets/javascripts/discourse/views/post_view.js +++ b/app/assets/javascripts/discourse/views/post_view.js @@ -9,8 +9,7 @@ Discourse.PostView = Discourse.View.extend({ classNames: ['topic-post', 'clearfix'], templateName: 'post', - classNameBindings: ['post.lastPost', - 'postTypeClass', + classNameBindings: ['postTypeClass', 'selected', 'post.hidden:hidden', 'post.deleted_at:deleted',