Skip to content

Commit

Permalink
Added change events against update field for file fields
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyjb committed Sep 10, 2018
1 parent 6e64f05 commit 2813e5b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 6 additions & 0 deletions module/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ export class FileField {

// Set the new state
this._state = 'accepting'

// Trigger a change event against the input
$.dispatch(this.input, 'change')
}

/**
Expand Down Expand Up @@ -389,6 +392,9 @@ export class FileField {

// Set the new state
this._state = 'viewing'

// Trigger a change event against the input
$.dispatch(this.input, 'change')
}

/**
Expand Down
10 changes: 3 additions & 7 deletions module/ui/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function defaultStatusTemplate(progress) {
} else if (progress >= 100) {
return 'Processing'
}
return `Uploading ${parseInt(progress)}%`
return `Uploading ${parseInt(progress, 10)}%`
}


Expand Down Expand Up @@ -147,9 +147,7 @@ export class Uploader {
)
$.ignore(
this._xhr.upload,
{
'progress': this._handlers.reqProgress,
}
{'progress': this._handlers.reqProgress}
)
this._xhr.abort()
}
Expand Down Expand Up @@ -272,9 +270,7 @@ export class Uploader {

$.listen(
this._xhr.upload,
{
'progress': this._handlers.reqProgress,
}
{'progress': this._handlers.reqProgress}
)

// Send the request
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manhattan-assets",
"version": "1.0.0-beta.13",
"version": "1.0.0-beta.14",
"description": "File and image uploads for forms.",
"engines": {
"node": ">=8.9.4"
Expand Down

0 comments on commit 2813e5b

Please sign in to comment.