transloadit-preset: Document progressBar

This commit is contained in:
Renée Kooi 2018-12-03 15:31:50 +01:00
parent 2058aa8df2
commit b24395f088
No known key found for this signature in database
GPG key ID: 8CDD5F0BC448F040
3 changed files with 22 additions and 2 deletions

View file

@ -47,6 +47,7 @@
attachments:
<input type="file">
</label>
<div class="progress"></div>
<p>
<button type="submit">

View file

@ -13,7 +13,8 @@ const formUppy = transloadit.form('#test-form', {
params: {
auth: { key: '05a61ed019fe11e783fdbd1f56c73eb0' },
template_id: 'be001500a56011e889f9cddd88df842c'
}
},
progressBar: '#test-form .progress'
})
formUppy.on('error', (err) => {

View file

@ -62,7 +62,25 @@ If provided, the [`<input accept>`](https://developer.mozilla.org/en-US/docs/Web
## Progress Reporting
**TODO have an option to mount a status bar somewhere**
**TODO also have an onProgress() callback or something for custom progress**
Uploads using HTML forms have no builtin progress reporting. With the Transloadit Preset, you can use the `progressBar` option to show an [@uppy/status-bar](/docs/status-bar): an element styled like a progress bar, reporting both upload and Assembly execution progress.
Point it to an element or a CSS selector:
```html
<form id="my-form" ...>
<div class="progress"></div>
</form>
<script>
transloadit.form('form#my-form', {
progressBar: '#my-form .progress'
// ...
})
</script>
```
The progress bar will be inserted _into_ that element (thus _not_ replace it).
## Dashboard