     # If we have folded parents we need to unfold each of them
     # and then finally scroll to or unfold ourself
     $folded_parents = $element.parents('.element-editor.folded')
-    @selectElement($element)
     if $folded_parents.length > 0
       @unfoldParents $folded_parents, =>
         @scrollToOrUnfold(element_id)


  # Marks an element as selected in the element window and scrolls to it.
  #
  selectElement: ($element) ->
    $("#element_area .element-editor").not($element[0]).removeClass("selected")
    $element.addClass("selected")
    @scrollToElement($element)
    return

  # Unfolds given parents until the last one is reached, then calls callback

  #
  scrollToOrUnfold: (element_id, callback) ->
    $el = $("#element_#{element_id}")
    if $el.hasClass("folded")
      @toggleFold(element_id, callback)
    else
      @selectElement($el, true)
    return

  # Scrolls the element window to given element editor dom element.
