Sha256: a55754cc10d54160a84f335a342c6a271843851ff7f30e01e08ff86d70781df5

Contents?: true

Size: 567 Bytes

Versions: 77

Compression:

Stored size: 567 Bytes

Contents

filter = (search, asset_box_input) ->
  term = (search || '').toLowerCase()

  asset_box_input.find('.attachments').first().find('.attachment').each (index) ->
    attachment = $(this)

    return if "#{attachment.find("input.asset-box-remove").first().val()}" == '1'

    if term == '' || attachment.find('.attachment-title').text().toLowerCase().indexOf(term) > -1
      attachment.show()
    else
      attachment.hide()

$(document).on 'keyup', '.filter-attachments', (event) ->
  obj = $(event.currentTarget)
  filter(obj.val(), obj.closest('.asset-box-input'))

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
effective_assets-1.4.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.3.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.3.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.3.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.2.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.2.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.2.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.2.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.2.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.1.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.1.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.1.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.0.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee