knownasilya/ember-plupload

queued items appears on all pl-upload queues

ashrafhasson opened this issue · 5 comments

Hi there,

I have the following template snippet that allows uploading a few images per post but it appears to me that the queued items reappear when viewing another post item (i.e., when navigating away to another post). I must be doing something wrong or fail to understand the use case, any help is appreciated.

          {{#pl-uploader for=(concat "upload-image-" vehicle.id) name=vehicleEdit extensions="jpg jpeg png gif" onfileadd="queueImageForUpload" as |queue dropzone|}}
              <div class="dropzone" id={{dropzone.id}}>
                  {{#if dropzone.active}}
                      {{#if dropzone.valid}}
                          Drop to upload
                      {{else}}
                          Invalid
                      {{/if}}
                  {{else if queue.length}}
                      Uploading {{queue.length}} files. ({{queue.progress}}%)
                  {{else}}
                      <p>
                          {{#if dropzone.enabled}}
                              Drag and drop images onto this area to upload them or
                          {{/if}}
                          <a id="upload-image-{{vehicle.id}}">Add an Image.</a>
                      </p>
                  {{/if}}
              </div>
          {{/pl-uploader}}

Thanks,

What is the value for vehicleEdit?

Ahh, that value requires to be unique per page. If the name of the queue is "test", then it will share state with all others.

Thanks @tim-evans that was it, sorry for creating an issue for this minor thing, but it wasn't so apparent to me at least. Btw, thanks for the great addon :)

No problemo!