Permalink
Browse files

sort comments collection

  • Loading branch information...
1 parent 0234064 commit ee48d37c5712bfa48742db3ed20ec257ebd43bad @dodo dodo committed Feb 28, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/models/topicpost.coffee
@@ -7,6 +7,9 @@ class exports.TopicPost extends Post
initialize: ->
@comments = new Posts parent:this
+ @comments.comparator = (post) ->
+ new Date(post.get_last_update()).getTime()
+
# Bubble changes up:
@comments.bind 'all', =>
@trigger 'change'

0 comments on commit ee48d37

Please sign in to comment.