Mixins share Properties
Closed this issue · 7 comments
If you are using DropletController in multiple Controllers in your app you will get some strange behaviour. The reason is this:
"Note that mixins extend a constructor's prototype so arrays and object literals defined as properties will be shared amongst objects that implement the mixin. If you want to define a property in a mixin that is not shared, you can define it either as a computed property or have it be created on initialization of the object."
See http://emberjs.com/api/classes/Ember.Mixin.html
The particular problem I am having would be solved if uploadStatus were defined like this:
uploadStatus: Ember.computed(function(){
return { uploading: false, percentComplete: 0, error: false };
}),
Do you recommend this change?
Yes, I am actually on to a bigger issue now, which is that I do not think the app is working in IE
I am looking into it more. Hopefully I can put together a PR request.
Thanks! Which version of IE are we talking about?
I just tried the sample app in IE 11.0.9600.16521 and it does not work.
I don't have a VM with IE11 installed. If you can put together a PR that would be great! Any help, please let me know. If you're having difficulties though, I'll install a VM with IE11 and take a look.
Ok, this one works:
https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload.js
So they are doing something right. I think the answer is in their _getDroppedFiles