#= require jquery
#= require jquery_ujs
#= require turbolinks
#= require_tree .

onReady = ->
  $('#gems-search').keyup ->
    if $("#query").val().length
      $.get $(this).attr('action'), $(this).serialize(), null, 'script'
      false

$(document).ready onReady

$(document).on 'page:change', ->
  if window._gaq?
    _gaq.push ['_trackPageview']
  else if window.pageTracker?
    pageTracker._trackPageview()

  onReady()

#= require jquery
#= require jquery_ujs
#= require turbolinks
#= require_tree .

onReady = ->
  $('#gems-search').keyup ->
    $.get $(this).attr('action'), $(this).serialize(), null, 'script'
    false

$(document).ready onReady

$(document).on 'page:change', ->
  if window._gaq?
    _gaq.push ['_trackPageview']
  else if window.pageTracker?
    pageTracker._trackPageview()

  onReady()

Revert "Don't send search query when query field is empty"
Revert "Don't send search query when query field is empty"

This reverts commit 6173b9b468889a31d84460eb95eac5ec9ec767bc.

Necessary because else when someone erases his search query in the input
field, the index page does not show again all the gems.
