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

[FEATURE] Uses accept field to validate provided filetypes #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timmcanty
Copy link

Attempt at working with #13

Would be helpful for my use case.


return fileExtensions.some(extension => validExtensions.indexOf(extension) === -1);
},

handleFiles: function(files) {
if (typeof(this.filesAreValid) === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the block into a function _validate and call your function in _validate?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 👍

if (typeof(this.filesAreValid) === 'function') {
if (!this.filesAreValid(files)) {
return;
}
}

if (this._invalidExtension(files)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmcanty can you add a setting validateExtension default can be true and add it to the readme`s Options section?

@fsmanuel
Copy link
Member

@timmcanty i updates ember cli and fixed the tests. can you rebase against master?

@timmcanty
Copy link
Author

Updated

@@ -25,6 +25,7 @@ export default Component.extend({
dropzone: true,
progress: true,
showProgress: false,
validateExtension: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validateExtensions (+s)

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

Successfully merging this pull request may close these issues.

None yet

2 participants