docs for openModal, closeModal, isModalOpen

This commit is contained in:
Artur Paikin 2017-09-11 14:10:01 -04:00
parent 91ec5dbdd6
commit be9ef1b076

View file

@ -21,12 +21,14 @@ Dashboard is a universal UI plugin for Uppy:
uppy.use(Dashboard, {
target: 'body',
getMetaFromForm: true,
trigger: '#uppy-select-files',
inline: false,
width: 750,
height: 550,
showProgressDetails: false,
hideUploadButton: false,
note: false,
disableStatusBar: false,
disableInformer: false,
closeModalOnClickOutside: false,
locale: {
strings: {
selectToUpload: 'Select files to upload',
@ -60,7 +62,7 @@ By default Dashboard will be rendered as a modal, which is opened via clicking o
### `trigger: '#uppy-select-files'`
String with a CSS selector for a button that will trigger opening Dashboard modal.
String with a CSS selector for a button that will trigger opening Dashboard modal. Multiple buttons or links can be used, if its a class selector (`.uppy-choose`, for example).
### `width: 750`
@ -88,4 +90,29 @@ See [general plugin options](/docs/plugins).
### `locale`
See [general plugin options](/docs/plugins).
See [general plugin options](/docs/plugins).
## Methods
### `openModal()`
Shows the Dashboard modal. Use it like this:
`uppy.getPlugin('Dashboard').openModal()`
### `closeModal()`
Hides the Dashboard modal. Use it like this:
`uppy.getPlugin('Dashboard').closeModal()`
### `isModalOpen()`
Returns `true` if the Dashboard modal is open, `false` otherwise.
```js
const dashboard = uppy.getPlugin('Dashboard')
if ( dashboard.isModalOpen() ) {
dashboard.closeModal()
}
```