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.9.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.9.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.9.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.9.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.9.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.9.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.8.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.7 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.6 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.4 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.3 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.2 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.1 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.7.0 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.9 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.8 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.7 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.6 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee
effective_assets-1.6.5 app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee