Sha256: 4e02811ffec6952d425c07809ef59a3d4c1e1d3dd1f65cf16adef89333d49417

Contents?: true

Size: 735 Bytes

Versions: 6

Compression:

Stored size: 735 Bytes

Contents

Spree.prepareAttachmentUploader = ->
  uploadZone = document.getElementById('attachment-upload-zone')
  if !uploadZone
    return

  attachmentUploads = new (Backbone.Collection)
  progressZone = document.getElementById('progress-zone')
  variantId = document.querySelector('input[name="attachment[viewable_id]"]').value

  new (Spree.Views.Attachments.UploadZone)(
    el: uploadZone
    collection: attachmentUploads
  )

  attachmentUploads.on 'add', (progressModel) ->
    progressModel.set variant_id: variantId

    progressView = new (Spree.Views.Images.UploadProgress)(model: progressModel)
    progressZone.appendChild progressView.render().el
    return

  return

Spree.ready ->
  Spree.prepareAttachmentUploader()
  return

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_product_attachments-0.0.7 app/assets/javascripts/spree/backend/attachments/upload.js.coffee
solidus_product_attachments-0.0.6 app/assets/javascripts/spree/backend/attachments/upload.js.coffee
solidus_product_attachments-0.0.5 app/assets/javascripts/spree/backend/attachments/upload.js.coffee
solidus_product_attachments-0.0.4 app/assets/javascripts/spree/backend/attachments/upload.js.coffee
solidus_product_attachments-0.0.2 app/assets/javascripts/spree/backend/attachments/upload.js.coffee
solidus_product_attachments-0.0.1 app/assets/javascripts/spree/backend/attachments/upload.js.coffee