Skip to content

mjosh954/DropzoneManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DropzoneManager


Description


A manager for processing multiple DropzoneJS objects.

Usage


Add the required script tags linking to your copy of the dropzone.js and dropzone-manager.min.js files

<script src="./path/to/dropzone.js"></script>
<script src="./path/to/dropzone-manager.min.js"></script>

Create a new instance.

var existingDropzones = Dropzone.instance || [];
var manager = new DropzoneManager(existingDropzones);

Add a dropzone

var newDropzone = DropzoneManager.createDropzone('myDropzoneId', { url: "/url/to/post"}));

manager.add(newDropzone);

To process any Dropzones that are currently registered in the manager, just call processAll, which you can pass in a callback that return the all the dropzones that were processed.

manager.processAll( { order : 'ASC' }, function(err, dropzones)) {
	if(!err) alert('finished');
});

or process a specific dropzone in the manager via id

manager.processById({ id: 'myDropzoneId' }, function(err, dropzone) {
	if(!err) alert('Dropzone: ' + dropzone.options.id + 'has been processed');
})

About

Manager for handling multiple dropzones

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published