     $($(this).data('target')).hide()
   )
   .keydown( (e) ->
-    # p will enter the search box, Esc will exit
-    if e.which == 80 and not $("input, textarea, select, a").is(":focus")
-      $("#global-search").focus()
-      e.preventDefault()
-      return
-    $("#global-search").blur() if $("#global-search").is(':focus') and e.which == 27
     if $("#interactive_design_modal").is(':visible')
       hideInteractiveDesignModal()     if e.which == 27
     if e.which == 77 and not $("input, textarea, select, a").is(":focus")


@globalReady = ->
  window.$isDirty = false
  # $("#global-search").typeahead(
  #   remote: root_url + 'search?q=%QUERY'
  # )
  # setFocusToField("#search")
  extensionsReady()
  $('[data-object~="form-load"]').submit()


    $($(this).data('target')).toggle()
    false
  )
  .on('change', ':input', ->
    if $("#isdirty").val() == '1'
      window.$isDirty = true
