     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

          document.styleSheets[0].addRule ruleName, properies, 0
        else
          document.styleSheets[0].insertRule ruleName + " { #{properies} }", 0
  
  # find half height of the node (px)
  middleOfHeight = (node) ->
    Math.abs $(node).height() / 2
