knownasilya / ember-plupload

Ember component for handling uploads using plupload
MIT License
87 stars 53 forks source link

Browse button is not clickable #135

Open epyx25 opened 5 years ago

epyx25 commented 5 years ago

I try to use the latest version (1.13.21) in my project, but I can not browse files. If I click on the div nothing happens. (Dropzone works fine). I wrapped ember-plupload in to a component

uploader-button.hbs

{{#pl-uploader class="top20" multiple=true name="pu" for="file-attachement" onfileadd="uploadLocalAttachments" as |queue dropzone|}}
    <div id="file-attachement">
        <div id='{{dropzone.id}}' class="dropzone dz-clickable">
            <div class="dz-default dz-message text-center">
                <div class="dz-icon icon-wrap icon-circle icon-wrap-md">
                    <i class="fa fa-cloud-upload fa-3x"></i>
                </div>
                <div>Upload</div>
            </div>
        </div>
    </div>
{{/pl-uploader}}

The generated HTML:

image

Console:

image

EDIT

uploader-button

  click() {
    console.log('element clicked')
    this.$('div.moxie-shim input[type=file]').trigger('click');
  },

Triggering the browse button through the wrapper component opens the file browsing window, but there are some weird errors in the console. image

knownasilya commented 5 years ago

I think the id needs to be on the div.

epyx25 commented 5 years ago

@knownasilya thanks for answering! sorry, I do not really get it. Which id should be on which div? In uploader-button.hbs I have an id on a div (file-attachement), the same value which the puploader component's for attribute has.

knownasilya commented 5 years ago

Something like this <div id="file-attachement">Upload</div>. This uses the id from the for argument above.