Skip to content

Commit

Permalink
sort comments collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dodo committed Feb 28, 2012
1 parent 0234064 commit ee48d37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/topicpost.coffee
Expand Up @@ -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'
Expand Down

0 comments on commit ee48d37

Please sign in to comment.