Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing multiple drop zones from being activated (unAssignDrop not working) #121

Open
schaazzz opened this issue Jun 7, 2016 · 4 comments
Labels

Comments

@schaazzz
Copy link

schaazzz commented Jun 7, 2016

In my application, I have 2 templates with file upload functionality using drop zones. When I upload files by dragging/dropping on one template, it triggers the file upload on both templates.

I've tried using unAssignDrop in the .onDestroyed callback but that didn't help, any ideas?

I'm assigning the drop zone in the .onRendered callback:

Files.resumable.assignDrop($("#div-attach-files-to-comment"));

And I'm un-assigning the drop zone in the .onDestroyed callback:

Files.resumable.unAssignDrop($("#div-attach-files-to-comment"));
@vsivsi
Copy link
Owner

vsivsi commented Jun 7, 2016

Hi, file-collection only creates a single instance of resumable.js. If you want multiple independent drop zones, you need to create/configure your own resumable.js instance for each template.

See: #71

@vsivsi vsivsi added the question label Jun 7, 2016
@schaazzz
Copy link
Author

schaazzz commented Jun 8, 2016

Thank you for your answer. But for the second part of my question, shouldn't calling Files.resumable.unAssignDrop remove the specified drop zone?

@vsivsi
Copy link
Owner

vsivsi commented Jun 8, 2016

I would assume so. If you have questions or issues about resumable.js please be aware that it is an independent project. File-collection only includes it as a convenience. I didn't write it and I don't have time to consult on its use client-side.

You can search the past issues and if necessary submit new ones on the resumable.js repo here:
https://github.com/23/resumable.js

@crapthings
Copy link
Contributor

crapthings commented Aug 30, 2016

@schaazzz we use this to clear events.

Documents.resumable.events = [];

its okay to put it into "comp did mount" or "comp will unmount ".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants