     if content.is(':hidden')
       content.show 0, ->
         uptHorizontalLine(node) unless $(node).hasClass('panel-root')
-        changeVerticalOfEachParent(node)
-
     else
       content.hide 0, ->
         uptHorizontalLine(node) unless $(node).hasClass('panel-root')
-        changeVerticalOfEachParent(node)
+    changeVerticalOfEachParent(node)
 
   # show-hide nodes
   $('.show-childrens').click ->

        newDistance = verticalBranchDist(element, 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

    $('.panel').each ->
      node = $(this).parent('.panel-container')
      if node.hasClass(parentId)
        content = $(this).find('.panel_contents')
        if parentContent.is(':visible')
          content.show 0, ->
            uptHorizontalLine(node) unless $(node).hasClass('panel-root')
            changeVerticalOfEachParent(node)
        else
          content.hide 0, ->
            uptHorizontalLine(node) unless $(node).hasClass('panel-root')
            changeVerticalOfEachParent(node)
      # todo: speed up: 1) by self vert. line; 2) by self + parent

  # select user
  $('.panel-header').on 'click', ->
