                     .replace('%desc', "No results found")
                     .replace '%name', "No results"
             $("#results").append $ $_tpl
+        $("#search input").keyup (e) -> doSearch(e)
+
   do search
        results.push item
      ).then ->
        $("#search input").focus()
        $("#search input").keyup (e) ->
          found = no
          filters = []
          $("#results").empty()

do (w = window, $ = jQuery) ->
  $(document).keyup (e) ->
    if e.keyCode == 27
      $("#results").empty().css 'display', 'none'
  
  $(document).click (e) ->
    $("#results").css 'display', 'none'
    
  $(document).on 'click', '.result, #search input', (e) ->
    e.stopPropagation()
  
  search = () ->
    json = search_config.type
    display_type = search_config.show_type
