-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: master
Are you sure you want to change the base?
Conversation
|
||
return fileExtensions.some(extension => validExtensions.indexOf(extension) === -1); | ||
}, | ||
|
||
handleFiles: function(files) { | ||
if (typeof(this.filesAreValid) === 'function') { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
3c1172a
to
c14b86d
Compare
if (typeof(this.filesAreValid) === 'function') { | ||
if (!this.filesAreValid(files)) { | ||
return; | ||
} | ||
} | ||
|
||
if (this._invalidExtension(files)) { |
There was a problem hiding this comment.
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?
@timmcanty i updates ember cli and fixed the tests. can you rebase against master? |
c14b86d
to
46a69a0
Compare
Updated |
@@ -25,6 +25,7 @@ export default Component.extend({ | |||
dropzone: true, | |||
progress: true, | |||
showProgress: false, | |||
validateExtension: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateExtensions
(+s)
Attempt at working with #13
Would be helpful for my use case.