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.12.2 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.12.1 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.12.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.5 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.4 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.3 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.2 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.1 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.11.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.10.1 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.10.0 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.14 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.13 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.12 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.11 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.10 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.9 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.8 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.7 app/assets/javascripts/effective_assets/asset_box.js.coffee
effective_assets-1.9.6 app/assets/javascripts/effective_assets/asset_box.js.coffee