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.6.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.9 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.8 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.7 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.6 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.5.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.9 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.8 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.7 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.6 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.4.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee