Update
This commit is contained in:
parent
205a8e1b08
commit
13e9bee16c
@ -29,7 +29,10 @@ export class AppUpload extends Component {
|
|||||||
'<span class="dp-upload-icon">📎</span>' +
|
'<span class="dp-upload-icon">📎</span>' +
|
||||||
'<span class="dp-upload-label"></span>' +
|
'<span class="dp-upload-label"></span>' +
|
||||||
'<span class="dp-upload-count" hidden></span>';
|
'<span class="dp-upload-count" hidden></span>';
|
||||||
this.button.querySelector(".dp-upload-label").textContent = this.attr("label", "Attach files");
|
const label = this.attr("label", "");
|
||||||
|
const labelEl = this.button.querySelector(".dp-upload-label");
|
||||||
|
labelEl.textContent = label;
|
||||||
|
labelEl.hidden = !label;
|
||||||
this.countEl = this.button.querySelector(".dp-upload-count");
|
this.countEl = this.button.querySelector(".dp-upload-count");
|
||||||
|
|
||||||
this.input = document.createElement("input");
|
this.input = document.createElement("input");
|
||||||
|
|||||||
@ -22,7 +22,7 @@ Set with the `mode` attribute:
|
|||||||
| Attribute | Default | Description |
|
| Attribute | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `mode` | `attachment` | `attachment`, `direct`, or `field`. |
|
| `mode` | `attachment` | `attachment`, `direct`, or `field`. |
|
||||||
| `label` | `Attach files` | Button text. |
|
| `label` | (none) | Optional button text shown beside the icon. |
|
||||||
| `multiple` | off | Allow selecting more than one file. |
|
| `multiple` | off | Allow selecting more than one file. |
|
||||||
| `directory` | off | Allow selecting a whole directory (`webkitdirectory`). |
|
| `directory` | off | Allow selecting a whole directory (`webkitdirectory`). |
|
||||||
| `accept` | (none) | Native accept filter, e.g. `image/*`. |
|
| `accept` | (none) | Native accept filter, e.g. `image/*`. |
|
||||||
|
|||||||
@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
<div class="auth-field auth-field-gap">
|
<div class="auth-field auth-field-gap">
|
||||||
<label>Add an image (optional)</label>
|
<label>Add an image (optional)</label>
|
||||||
<dp-upload mode="field" field-name="image" accept="image/*" label="Add image"></dp-upload>
|
<dp-upload mode="field" field-name="image" accept="image/*"></dp-upload>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="auth-field auth-field-gap">
|
<div class="auth-field auth-field-gap">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user