* Creates the upload button.
*/
_createButton() {
+ this._fileUpload = document.createElement("input");
this._fileUpload.type = "file";
this._fileUpload.name = this._options.name;
if (this._options.multiple) {
this._fileUpload.accept = this._options.acceptableFiles.join(",");
}
this._fileUpload.addEventListener("change", (ev) => this._upload(ev));
+ this._button = document.createElement("p");
this._button.className = "button uploadButton";
this._button.setAttribute("role", "button");
this._fileUpload.addEventListener("focus", () => {
import { FileCollection, FileElements, FileLikeObject, UploadId, UploadOptions } from "./Upload/Data";
abstract class Upload<TOptions extends UploadOptions = UploadOptions> {
- protected readonly _button = document.createElement("p");
+ protected _button = document.createElement("p");
protected readonly _buttonContainer: HTMLElement;
protected readonly _fileElements: FileElements[] = [];
- protected readonly _fileUpload = document.createElement("input");
+ protected _fileUpload = document.createElement("input");
protected _internalFileId = 0;
protected readonly _multiFileUploadIds: unknown[] = [];
protected readonly _options: TOptions;
* Creates the upload button.
*/
protected _createButton(): void {
+ this._fileUpload = document.createElement("input");
this._fileUpload.type = "file";
this._fileUpload.name = this._options.name;
if (this._options.multiple) {
}
this._fileUpload.addEventListener("change", (ev) => this._upload(ev));
+ this._button = document.createElement("p");
this._button.className = "button uploadButton";
this._button.setAttribute("role", "button");
this._fileUpload.addEventListener("focus", () => {