danielm / uploader

A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
https://danielmg.org/demo/java-script/uploader
MIT License
1.17k stars 385 forks source link

add plugin to dynamically added element #24

Closed dellert closed 9 years ago

dellert commented 9 years ago

How can I add yours plugin to dynamically added elements on page? thanks

dellert commented 9 years ago

found a solution

kirschbaumj commented 7 years ago

Hello,

I am also having problems using this on DOM elements that get dynamically to the page (Vue.js in my case). It seems to be the on drop and on change events in the init method. I was able to get this working locally by changing the jquery selector to

$(document).on('drop', widget.element, function(evt){

and

$(document).on('change', widget.element.find('input[type=file]'), function(evt){

on lines 109 and 117 of the full/non-minified version of the plugin. Could this be looked into?

Thanks!