Sha256: a53908fa221d985fe966d3296f3432cbcec121c1c917c40635816e2362fd283c

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

# -----------------------------------------------------------------------------
# LIST SEARCH
# -----------------------------------------------------------------------------
@_listBindSearch = (listEl) ->
  $input     = listEl.$search
  arrayStore = listEl.config.arrayStore

  $input.show()

  $input.on 'keydown', 'input', (e) =>
    if e.keyCode == 13
      query = $(e.target).val()
      listEl._loading -> arrayStore.search(query)

  $input.on 'click', '.icon', (e) =>
    e.preventDefault()
    listEl.$el.addClass 'list-search'
    $input.find('input').focus()

  $input.on 'click', '.cancel', (e) =>
    e.preventDefault()
    listEl.$el.removeClass 'list-search'
    $input.find('input').val('')
    listEl._loading -> arrayStore.reset()




Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chr-0.1.5 app/assets/javascripts/chr/core/list-search.coffee
chr-0.1.4 app/assets/javascripts/chr/core/_listSearch.coffee
chr-0.1.2 app/assets/javascripts/chr/core/_listSearch.coffee
chr-0.1.1 app/assets/javascripts/chr/core/_listSearch.coffee
chr-0.1.0 app/assets/javascripts/chr/core/_listSearch.coffee