Sha256: e30b1b23fcc5821682d7659258371555160bcd6e31cb67fd2a7cfbaf0e2301ae

Contents?: true

Size: 1.15 KB

Versions: 79

Compression:

Stored size: 1.15 KB

Contents

$(document).on 'direct-upload:initialize', (event) ->
  $target = $(event.target)
  template = $target.data('progress-template').replace('$ID$', event.detail.id).replace('$FILENAME$', event.detail.file.name)
  $target.siblings('.uploads').append(template)

$(document).on 'direct-upload:start', (event) ->
  $("[data-direct-upload-id=#{event.detail.id}]").removeClass('direct-upload--pending')

$(document).on 'direct-upload:progress', (event) ->
  $("[data-direct-upload-id=#{event.detail.id}]").children('.direct-upload__progress').css('width', "#{event.detail.progress}%")

$(document).on 'direct-upload:error', (event) ->
  $("[data-direct-upload-id=#{event.detail.id}]").addClass('direct-upload--error').attr('title', event.detail.error)

$(document).on 'direct-upload:end', (event) ->
  $obj = $("[data-direct-upload-id=#{event.detail.id}]")

  $obj.addClass('direct-upload--complete')

  # Rails UJS fix
  $obj.closest('form').find('[type=submit][data-confirm]').data('confirmed', true)

$(document).on 'change', "input[type='file'][data-click-submit]", (event) ->
  $(event.currentTarget).closest('form').find('button[type=submit],input[type=submit]').first().click()

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
effective_bootstrap-1.14.13 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.12 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.11 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.10 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.9 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.8 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.7 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.6 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.5 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.4 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.3 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.2 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.1 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-1.14.0 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.7 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.6 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.5 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.4 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.3 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.2 app/assets/javascripts/effective_file/initialize.js.coffee