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?
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?
@kvz you're right. Opened a question on the community forum: https://community.transloadit.com/t/is-it-possible-to-catch-the-trigger-that-opened-the-dashboard/14547
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 馃憤
Most helpful comment
@kvz you're right. Opened a question on the community forum: https://community.transloadit.com/t/is-it-possible-to-catch-the-trigger-that-opened-the-dashboard/14547