-
Notifications
You must be signed in to change notification settings - Fork 25
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
Issue#14: Meteor 0.8.x and Blaze compatibility #16
Conversation
Sorry it took such a long time to get round to this. In the end was much simpler than I expected! |
Thanks lindleycb for your fix, but didn't worked out for me with Meteor 0.8.1.3
|
Can you create a small project that displays this problem as per these instructions: https://www.eventedmind.com/feed/github-issues-and-reproductions and I'll see if I can work out what's going wrong |
Okay, I created a repo. I didn't open a new issue cause this is EventedMinds repo. I couldn't open a issue for the repo meteor-file that you created (https://github.com/lindleycb/meteor-file/issues doesn't work). Here's the link: Thanks in advance! |
Hi, Thanks for producing that repo - it helped a lot. I ran this up in the debugger and I think I can see what's happening. The issue is not in the meteor-file package but in the way it's being called and I think that's just all down to the way that closures work. When you iterate the chosen files: It looks like you should be passing in the next file but, as this callback won't be called until the file has been inserted in the Files collection, "files[i]" no longer points to the expected file. So, if you put a breakpoint in the MeteorFile.upload method, you'll see that the "file" parameter is undefined: If you tweak your code just a little to use $.each instead of a for loop, this doesn't happen and the file uploads correctly: Just one more thought: I didn't actually have to make any changes to meteor-file.js to port to Meteor 0.8, my changes were just down to the replacement of Spark with Spacebars in the {{#FileUploader}} component. Have you considered using this instead of writing all that template code yourself? There's an EventedMind video about it here: https://www.eventedmind.com/feed/meteor-file-uploader-part-9-build-a-ui-component Hope this helps. Cheers, Chris |
Wow thanks for your help! Uploading seems to work fine - great! I will have into the UI-component-version... Yes, it helps a lot! |
I noticed that and I think there are a couple of things: Good luck! |
Oh wow thanks again! I checked the bootstrap-3 docs and managed to fix it:
and
What do you mean with tweaking {{#each files}} (sorry I'm not a native speaker)? I noticed that multiple file select isn't working - so I guess that what you mean. A MeteorFile can contain multiple files in it's Collection, right? Probably I need to push all files to one MeteorFile instead of creating multiple MeteorFiles?! Thanks in advance! |
Sorry for not replying on this earlier - been really busy recently - I'm aware it still needs answering and will hopefully get a chance to look into it before the end of the month. |
Hi, Apologies for the delay but I've now looked into this and made a small change to the meteor-file project to support displaying a list of files as you require. I've also created a new github project (https://github.com/lindleycb/meteor-file-example) holding and example usage based on the Chris' screencast example here: https://www.eventedmind.com/feed/meteor-file-uploader-part-9-build-a-ui-component . It all seems to work fine for me (see screenshot below) so hopefully it will for you too! Good luck! Chris |
Issue#14: Meteor 0.8.x and Blaze compatibility
Oh cool thanks! I haven't worked on this in a little while. Interested in helping to deploy a new version? |
Hi Chris, Yep happy to help out if I can be of use. Just let me know what you want me to do. |
Ported code to Meteor 0.8.x and Blaze as discussed in #14