Sha256: 8781f9a618792024271e57265dfa21857a7125fa3d1d2e2670dc18f4033ac8e9

Contents?: true

Size: 484 Bytes

Versions: 7

Compression:

Stored size: 484 Bytes

Contents

ObserveJS.bind 'Posts.Filter', class
  loaded: =>
    for el in @element().elements
      switch el.type
        when 'text', 'hidden' then @on 'input', el, @search

    document.querySelector('input.search').focus()

  search: =>
    xhr = new ObserveJS.XHR(@element())
    for el in @element().elements
      switch el.type
        when 'text', 'hidden' then xhr.data.set(el.name, el.value) if el.value.length > 0
    xhr.send()

    document.querySelector('input.search').focus()

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ecrire-0.31.2 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.31.1 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.31.0 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.30.3 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.30.2 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.30.1 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee
ecrire-0.30.0 lib/ecrire/app/assets/javascripts/admin/posts/filter.coffee