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

rename File to FileModel #11

Open
flyerhzm opened this issue Apr 2, 2014 · 5 comments
Open

rename File to FileModel #11

flyerhzm opened this issue Apr 2, 2014 · 5 comments

Comments

@flyerhzm
Copy link
Contributor

flyerhzm commented Apr 2, 2014

To make it consistent FileModel, FileCollection, FileView.

But I got some errors when rename File to FileModel, any idea?

@sroze
Copy link
Owner

sroze commented Apr 2, 2014

Which errors ? :)

@flyerhzm
Copy link
Contributor Author

flyerhzm commented Apr 2, 2014

This is what I changed xinminlabs@82a64ea

when I tried in chrome console

> var files = new Backbone.UploadManager.FileCollection();
  undefined
> files
  child {length: 0, models: Array[0], _byId: Object, constructor: function, model: undefined…}
> files.model
  undefined

files.model should return FileModel rather than undefined, which causes unexpected errors in other backbone plugins

@sroze
Copy link
Owner

sroze commented Apr 2, 2014

There's not reason.

Try to add a breakpoint line 339 and watch this.FileModel.
https://github.com/xinminlabs/backbone-upload-manager/blob/82a64ea1feceb64bfbafbd753730b9d6e7af9e17/js/backbone.upload-manager.js#L339

@flyerhzm
Copy link
Contributor Author

flyerhzm commented Apr 2, 2014

@sroze I think you are using the wrong scope, I reverted my changes and test in chrome console again

> var files = new Backbone.UploadManager.FileCollection();
  undefined
> files.model
  function File() { [native code] }

this.File returns File in html5 FileAPI.

@flyerhzm
Copy link
Contributor Author

flyerhzm commented Apr 4, 2014

any idea?

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

No branches or pull requests

2 participants