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