 
     # Setup the add and purge buttons if the user
     # didn't pass in any.
-<<<<<<< HEAD
     if not data.addButton? and data.addButton isnt false
       data.addButton =
         title: "Add a #{singleTitle}"

          $(".#{data.single}-search").addClass("hide")
          $(".#{data.single}-search-query").attr("value","")
        return false
=======
    navEvents[templateEvent] = (event, template) ->
      context = template.data
      single = context.single
      value = event.target.value
      $(".#{data.single}-search").removeClass("hide")
      if value?
        if value.has("=")
          key = value.split("=")[0]
          search_string = value.split("=")[1]
          search = {}
          search[key] = 
            $regex: ".*#{search_string}.*"
            $options: "i"
          Session.set("#{data.single}Find", search)
        else if value.has(" ")
          search_terms = value.split " "
          regex_array = 
            for term in search_terms
               ".*#{term}.*"
          regex = regex_array.join "|"
          Session.set("#{data.single}Find", {name: {$regex: regex, $options: "i"}})
        else
          regex = ".*#{value}.*"
          Session.set("#{data.single}Find", {name: {$regex: regex, $options: "i"}})
      else
        Session.set("#{data.single}Find", {})
        $(".#{data.single}-search").addClass("hide")
        $(".#{data.single}-search-query").attr("value","")
      return false
>>>>>>> 2d6d00a2da830ee8d011084d970a22eed0949f7f

    if data.nav?.events?
      _.extend(data.nav.events, navEvents)

    # Build up an array of the items to be in the list
    # adding in the context data
    items = []
    # if data.parent_id
    #   data.subscribeCallback(data.parent_id)
    # else
