Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addon/components/file-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default Ember.Component.extend(Ember.Evented, {
'form',
'type',
'accept',
'capture',
'autofocus',
'required',
'multiple'
Expand Down
3 changes: 2 additions & 1 deletion addon/uploaders/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export default Ember.Object.extend(Ember.Evented, {
}
}

if (files.constructor === FileList) {
// if is a array of files ...
if (files.constructor === FileList || files.constructor === Array) {
const paramKey = `${this.toNamespacedParam(this.paramName)}[]`;

for (let i = 0; i < files.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions addon/uploaders/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default Uploader.extend({
/**
* Request signed upload policy and upload file(s) and any extra data
*
* @param {object|array} files One file object or one array of files object
* @param {object} file A file object
* @param {object} extra Extra data to be sent with the upload
* @return {object} Returns a Ember.RSVP.Promise wrapping the signing
* request object
Expand Down Expand Up @@ -61,7 +61,7 @@ export default Uploader.extend({
/**
* Request signed upload policy
*
* @param {object|array} files One file object or one array of files object
* @param {object} file A file object
* @param {object} extra Extra data to be sent with the upload
* @return {object} Returns a Ember.RSVP.Promise wrapping the signing
* request object
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Ember Uploader",
"name": "ember-uploader",
"version": "1.2.2",
"version": "1.2.3",
"description": "Ember.js addon to facilitate uploading",
"homepage": "https://github.com/benefitcloud/ember-uploader",
"license": "MIT",
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/file-field-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ test('it triggers `filesDidChange` on change', () => {

deepEqual(result, [ 'foo' ], 'it returns the files that changed');
});

test('attribute bindings are correct', () => {
const fileField = FileField.extend({}).create();

deepEqual(fileField.get('attributeBindings'), [
'ariaRole:role',
'name',
'disabled',
'form',
'type',
'accept',
'capture',
'autofocus',
'required',
'multiple'
]);
});