Uppy: Dashboard trigger on class names works only on the first instance

Created on 8 Sep 2017  路  7Comments  路  Source: transloadit/uppy

I would like to be able to open the Uppy Dashboard clicking on more than one button, so I tried to use a class instead of an id for the trigger, but it didn't work: only the first button with the choosen class will open the Dashboard.

.use(Uppy.Dashboard, {
    trigger: '.upload-btn'
})

As a bonus question I'm wondering: can I then get inside uppy which was the button making the call?

Feature

Most helpful comment

All 7 comments

Thanks for the suggestion! Also considering this in #328.

Thanks to you @arturi!
Can you also help me with my other question: can I get inside uppy which was the button that triggered its opening?

Seems this one was prematurely closed, but also seems the question is a bit outside of the scope of this issue (tracker) maybe? Perhaps a better place for it would be https://community.transloadit.com/c/uppy?

Replied there!

@arturi do you think that with this update Uppy we'll be able to be triggered also by elements with the right class but added after the initialization of the Dashboard? Or I will need to do something like this with the new element?

var showUppyModal = function() {
  uppy.getPlugin('Dashboard').openModal();
}
element.addEventListener('click', showUppyModal)

Yeah, I believe the element has to be on the page on initialization for Uppy to add a listener to it, so your method is the way to go 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eltercero picture eltercero  路  4Comments

ogtfaber picture ogtfaber  路  4Comments

rrjanbiah picture rrjanbiah  路  3Comments

hikurangi picture hikurangi  路  4Comments

anushkamds picture anushkamds  路  3Comments