       )
 
   uptHorizontalLine = (node) ->
-    id = $(node).attr 'id'
-    newHeight = -Math.abs middleOfHeight(node)
-    line = getCSSRule('[id="' + id + '"]::after')
-    line.style.marginTop = newHeight.toString().concat('px')
+    if $(node).hasClass('panel-root')
+      false
+    else
+      id = $(node).attr 'id'
+      newHeight = -Math.abs middleOfHeight(node)
+      line = getCSSRule('[id="' + id + '"]::after')
+      line.style.marginTop = newHeight.toString().concat('px')
 
   findPanelHeader = (object) ->
     object.find('.panel').find('.panel-header')

      if $(this).hasClass(id)
        findPanelHeader($(this)).css('background-color', parentColor)

  # show-hide single div
  $('.show-content').click ->
    node    = $(this).parents('.panel-container')
    nodeId  = $(node).attr 'id'

    
  changeVerticalOfEachParent = (nodeToStart) ->
    # find actual parents
    nodeClasses = $(nodeToStart).attr('class').split(' ')
    allParents  = $(nodeToStart).prevAll('.panel-parent')

    parentIds   = $.map(allParents, (el) -> $(el).attr 'id')
    actualIds   = similarItems(nodeClasses, parentIds)

    # add node id to array
    actualIds.push $(nodeToStart).attr('id')
    # ids to array of jquery elements
    actualCollection = getElements(actualIds)

    $.each actualCollection, (i, element) -> updateVerticalLine(element)

  updateVerticalLine = (node) ->
    nodeId = $(node).attr('id')
    lastChild = $(node).parent().find(
      ".panel-container[data-last-child=#{nodeId}]")

    if $(lastChild).length
      newDistance = verticalBranchDist(node, lastChild)
      line = getCSSRule('[id="' + nodeId + '"]::before')
      line.style.height = newDistance.toString().concat('px')

  # inherit color from parent panel on load
  # if parent has no color, inherit from parent of parent
