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-0.13.1 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.13.0 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.7 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.6 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.5 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.4 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.3 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.2 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.1 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.12.0 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.22 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.21 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.20 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.19 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.18 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.17 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.16 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.15 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.14 app/assets/javascripts/effective_file/initialize.js.coffee
effective_bootstrap-0.11.13 app/assets/javascripts/effective_file/initialize.js.coffee