 
   attached: ->
     @isHorizontal = @parent().hasClass("horizontal")
-    @prevPane = @prev()
-    @nextPane = @next()
 
   detached: ->
 


  resizeToFitContent: ->
    # clear flex-grow css style of both pane
    @prevPane.css('flexGrow', '')
    @nextPane.css('flexGrow', '')

  resizeStarted: (e)->
    e.stopPropagation()

    return @resizeStopped() unless which is 1

    if @isHorizontal
      totalWidth = @prev().outerWidth() + @next().outerWidth()
      #get the left and right width after move the resize view
      leftWidth = @fixInRange(pageX - @prev().offset().left, 0, totalWidth)
      rightWidth = totalWidth - leftWidth
      # set the flex grow by the ratio of left width and right width
      # to change pane width
      @setFlexGrow(leftWidth, rightWidth)
    else
      totalHeight = @prev().outerHeight() + @next().outerHeight()
      topHeight = @fixInRange(pageY - @prev().offset().top, 0, totalHeight)
      bottomHeight = totalHeight - topHeight
      @setFlexGrow(topHeight, bottomHeight)

