 
     ul = elem.find('ul:eq(0)')
     if(ul.length && ul.children().length)
-      App.TreeNavigator.closeNodes(ul.children())
+      App.TreeNavigator.setNodes(ul.children())
 
     $('[data-tree-navigator] span').on
       click: (e) ->


    children.each ->
      link = $(this).prev('a')
      $('<span class="closed"></span>').insertBefore(link)
      $(this).hide()
      App.TreeNavigator.closeNodes($(this).children())

  initialize: ->
    elem = $('[data-tree-navigator]')

App.TreeNavigator =
  setNodes: (nodes) ->
    children = nodes.children('ul')

    if(children.length == 0)
