 $ ->
-  saveTextSearchCondition = (selectTag) ->
+  saveTextSearchCondition = ->
     cond =
-      selectedValue: selectTag.find(':selected').val()
+      selectedValue: $('select#category').find(':selected').val()
       query: $('input#q').val()
 
     localStorage.setItem('textSearch', JSON.stringify(cond))

    selectTag    = $('select#category')
    searchTarget = selectTag.find(':selected').data('searchTarget')

    saveTextSearchCondition(selectTag)

    switch searchTarget
      when 'category'

  $(window).on "load", (e) ->
    search = window.location.search

    if search
      saveTextSearchCondition()
    else
      cond = JSON.parse(localStorage.getItem('textSearch'))

      if cond
