     messageView = new MessageItemView model: message
     @$el.append messageView.render().$el
 
+  scrollToBottom: ->
+    @$el.scrollTop @$el.prop 'scrollHeight'
+
 class ChatView extends Backbone.View
   el: '.main'
   template: _.template $('#chat-view').html()

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

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

    @messageListView = new MessageListView collection: @model.get('messages')
    @messageListView.$el = @.$('.messages')
    @messageListView.render()
    @messageListView.scrollToBottom()
    this

  sendMessage: (event) =>
    event.preventDefault()
