Sha256: eb3bd5154d1d772a6a0314c406892d2e8373e17686565922f721a90599866b8a

Contents?: true

Size: 1.03 KB

Versions: 60

Compression:

Stored size: 1.03 KB

Contents

$(document).on 's3_file_added', (event, file) ->
  obj = $(event.target)
  obj.closest('.error').removeClass('error')
  obj.parent().siblings('.help-inline,.inline-errors').remove()

$(document).on 's3_uploads_complete', (_, uploader) ->
  uploader.closest('.asset-box-input').find('.filter-attachments').val('')

$(document).on 's3_upload_failed', (_, uploader, content) ->
  uploader.closest('.asset-box-input').find('.filter-attachments').val('')
  alert("An error occurred while uploading #{content.filename}.\n\nThe returned error message is: '#{content.error_thrown}'\n\nPlease try again.")

$(document).on 'click', 'a.attachment-remove', (event) ->
  event.preventDefault()
  $attachmentDiv = $(event.target).closest('.attachment')

  $attachmentDiv.find('input.asset-box-remove').first().val(1)
  $attachmentDiv.hide()

  # Correct the attachment count
  $assetBoxInput = $attachmentDiv.closest('div.asset-box-input')
  count = parseInt($assetBoxInput.attr('data-attachment-count'), 10)
  $assetBoxInput.attr('data-attachment-count', count - 1)

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
effective_assets-1.9.5 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.4 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.3 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.2 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.1 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.8.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.7 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.6 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.5 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.4 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.3 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.2 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.1 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.7.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.6.9 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.6.8 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.6.7 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.6.6 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.6.5 app/assets/javascripts/effective_assets/asset_box.js.coffee