       <Loader isVisable={@state.isLoading} text={@state.loadingText} />
     </div>
 
-  componentDidUpdate: (prevProps, prevState) ->
-    # If loading without an offset, start tailing immediately
-    if !@props.offset and @props.logLines.length > 0 and prevProps.logLines.length is 0
-      @scrollToBottom()
-    else if @tailingPoll
-      @scrollToBottom()
+  # ============================================================================
+  # Utility Methods                                                            |
+  # ============================================================================
 
   setScrollHeight: (height) ->
     $(@scrollNode).scrollTop(height);

Loader = require './Loader'

Contents = React.createClass

  getInitialState: ->
    @state =

  componentDidMount: ->
    @scrollNode = @refs.scrollContainer.getDOMNode()

  componentDidUpdate: (prevProps, prevState) ->
    # If loading without an offset, start tailing immediately
    if !@props.offset and @props.logLines.length > 0 and prevProps.logLines.length is 0
      @scrollToBottom()
    else if @tailingPoll
      @scrollToBottom()

  componentWillUnmount: ->
    $(window).off 'resize orientationChange', @handleResize

  # ============================================================================
  # Event Handlers                                                             |
  # ============================================================================

  handleResize: ->
    @setState
