     @messageListView = new MessageListView collection: @model.get('messages')
     @messageListView.$el = @.$('.messages')
     @messageListView.render()
-    @scrollToBottom()
+    @messageListView.scrollToBottom()
     this
-
-  scrollToBottom: ->
-    @$el.scrollTop @$el.prop 'scrollHeight'
 
   sendMessage: (event) =>
     event.preventDefault()

    messageView = new MessageItemView model: message
    @$el.append messageView.render().$el

class ChatView extends Backbone.View
  el: '.main'
  template: _.template $('#chat-view').html()

      success: =>
        @$el.find('textarea') .val ''
        @messageListView.collection.add message
        @messageListView.scrollToBottom()

class NavigationView extends Backbone.View
  el: '.navigation'
