|
@@ -6,11 +6,14 @@ import {MenuItem} from "./MenuItem";
|
|
|
export class Upload extends MenuItem {
|
|
|
constructor(vditor: IVditor, menuItem: IMenuItem) {
|
|
|
super(vditor, menuItem);
|
|
|
- let inputHTML = '<input multiple="multiple" type="file">';
|
|
|
+ let inputHTML = '<input type="file"';
|
|
|
+ if (vditor.options.upload.multiple) {
|
|
|
+ inputHTML += ' multiple="multiple"';
|
|
|
+ }
|
|
|
if (vditor.options.upload.accept) {
|
|
|
- inputHTML = `<input multiple="multiple" type="file" accept="${vditor.options.upload.accept}">`;
|
|
|
+ inputHTML += ` accept="${vditor.options.upload.accept}"`;
|
|
|
}
|
|
|
- this.element.children[0].innerHTML = `${(menuItem.icon || uploadSVG)}${inputHTML}`;
|
|
|
+ this.element.children[0].innerHTML = `${(menuItem.icon || uploadSVG)}${inputHTML}>`;
|
|
|
this._bindEvent(vditor);
|
|
|
}
|
|
|
|