mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
transloadit-preset: Document progressBar
This commit is contained in:
parent
2058aa8df2
commit
b24395f088
3 changed files with 22 additions and 2 deletions
|
|
@ -47,6 +47,7 @@
|
|||
attachments:
|
||||
<input type="file">
|
||||
</label>
|
||||
<div class="progress"></div>
|
||||
|
||||
<p>
|
||||
<button type="submit">
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue