new DropZone(dropZoneElement, fileTypes, callback)
- Description:
Constructor.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
dropZoneElement |
Element | The element to render the dropzone. |
fileTypes |
String | The file types that are allowed to be uploaded. Example: image/* |
callback |
CallableFunction | The function to call when a file is dropped. |
Members
callback :CallableFunction
- Description:
The function to call when a file is dropped.
- Source:
The function to call when a file is dropped.
Type:
- CallableFunction
dropZoneElement :Element
- Description:
The element to render the dropzone.
- Source:
The element to render the dropzone.
Type:
- Element
dropZoneLabel :string
- Description:
The label to display in the dropzone.
- Source:
The label to display in the dropzone.
Type:
- string
fileTypes :String
- Description:
The file types that are allowed to be uploaded.
- Source:
The file types that are allowed to be uploaded.
Type:
- String
Methods
getDropZoneContainerFromEvent(e) → {HTMLElement|bool}
- Description:
Get the dropzone container.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The event. |
Returns:
- Type
- HTMLElement | bool
getDropZoneFromEvent(e) → {HTMLElement|bool}
- Description:
Get the dropzone.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The event. |
Returns:
- Type
- HTMLElement | bool
getFileElementFromEvent(e) → {HTMLElement|bool}
- Description:
Get the file element.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The event. |
Returns:
- Type
- HTMLElement | bool
getLabel() → {String}
- Description:
Get the label to display in the dropzone.
- Source:
Returns:
The label to display in the dropzone.
- Type
- String
init() → {DropZone}
- Description:
Initialise the dropzone.
- Source:
Returns:
- Type
- DropZone
(async) renderDropZone(dropZoneElement, fileTypes) → {Promise}
- Description:
Render the dropzone.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
dropZoneElement |
Element | The element to render the dropzone. |
fileTypes |
String | The file types that are allowed to be uploaded. |
Returns:
- Type
- Promise
setLabel(label)
- Description:
Set the label to display in the dropzone.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
label |
String | The label to display in the dropzone. |