       return if data.session_id isnt @session.session_id
       @focus()
     )
+
+  onLayoutChange: =>
+    @scrollToBottom()
 
   render: ->
     @html App.view('customer_chat/chat_window')

      isNew: isNew
      timestamp: Date.now()

    @scrollToBottom()

  showWritingLoader: =>
    if !@isTyping

    @chat = App.Chat.find(@session.chat_id)
    @name = "#{@chat.displayName()} ##{@session.id}"

    @on 'layout-change', @onLayoutChange

    @bind('chat_session_typing', (data) =>
      return if data.session_id isnt @session.session_id
