From f565742e7817d82ee24de433f789b468455ce14e Mon Sep 17 00:00:00 2001 From: Abayomi Amusa Date: Thu, 7 Mar 2024 07:08:56 +0100 Subject: [PATCH] minor bug fixes --- CHANGELOG.md | 6 +++++- core/custupCore.d.ts | 2 +- core/custupCore.d.ts.map | 2 +- core/custupCore.js | 6 +++--- package.json | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae51790..e1d0deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## 1.1.5 (2024-03-05) +## 1.1.6 (2024-03-06) + +- Fix: An undefined variable bug caused by the method that returns the attached form field as an HTML element or undefined if not provided. + +## 1.1.5 (2024-03-06) - Fix: Typescript bugs caused by not setting optional options as optional. diff --git a/core/custupCore.d.ts b/core/custupCore.d.ts index 7dab8db..ae51ba0 100644 --- a/core/custupCore.d.ts +++ b/core/custupCore.d.ts @@ -889,7 +889,7 @@ export default class CustUpCore extends EventTarget { * @method upload - the method to upload file to the endpoint * @param {string | undefined} file_id - the id of the file to upload in the case of a single file, all the files will be uploaded serially if not provided */ - upload(file_id: string | undefined): void; + upload(file_id?: string | undefined): void; /** * @method retry_upload - to retry uploading a file * @param {string} file_id - the id of the file to retry diff --git a/core/custupCore.d.ts.map b/core/custupCore.d.ts.map index 4e60d1e..35b94de 100644 --- a/core/custupCore.d.ts.map +++ b/core/custupCore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"custupCore.d.ts","sourceRoot":"","sources":["custupCore.js"],"names":[],"mappings":"AASA;IAsVI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8FE;IACF,6EAkBC;IAtcD;;;OAGG;IACH,oBAAsB;IAGtB;;;OAGG;IACH,8BAAkB;IAElB;;;OAGG;IACH,+BAAmB;IAEnB;;;OAGG;IACH,8BAAkB;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KAAC,KAAK,GAAG,QAI5C;IAED;;;;;;OAMG;IACH,kCALW,WAAW,GAAG,IAAI,iBAClB,WAAW,IAAI,gCAEb,MAAM,WAAW,CAAC,CAoI9B;IAED;;;;;;;OAOG;IACH,4BANW,MAAM,QACN,OAAO,GAAG,SAAS,GAAG,MAAM,UAC5B,OAAO,YACP,MAAM,GACJ,WAAW,IAAI,CAI3B;CACJ"} \ No newline at end of file +{"version":3,"file":"custupCore.d.ts","sourceRoot":"","sources":["custupCore.js"],"names":[],"mappings":"AASA;IAsVI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8FE;IACF,6EAkBC;IAtcD;;;OAGG;IACH,oBAAsB;IAGtB;;;OAGG;IACH,8BAAkB;IAElB;;;OAGG;IACH,+BAAmB;IAEnB;;;OAGG;IACH,8BAAkB;IAElB;;;OAGG;IACH,2CAA+B;IAE/B;;;OAGG;IACH,yCAA6B;IAE7B;;;OAGG;IACH,sCAAkC;IAElC;;;OAGG;IACH,8BAAkC;IAElC;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2B;IAE3B;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAggDA;;;;;;WAMG;;;;;;;;;;;;MAtgDmB;IAEtB;;;OAGG;IACH,yBAA6B;IAE7B;;OAEG;IACH,oBAAgB;IAEhB;;OAEG;IACH,sBAAkB;IAElB;;OAEG;IACH,sCAAyC;IAGzC;;OAEG;IACH,yCAA4C;IAE5C;;OAEG;IACH,4BAA2D;IAE3D;;OAEG;IACH;;;;;;;;;;;;;;qCArDA;;;WAGG;;;;;;;;;;;;;;;yCA+BH;;WAEG;;;;;MAiB0B;IAG7B,qBAAsB;IACtB,2BAA4B;IAC5B,2BAA4B;IAC5B,gCAAiC;IACjC,iCAAkC;IAClC,0B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ACH,yCAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,iCAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mCAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,+BAOhB;IAED;;;;;OAKG;IACH,eAJW,IAAI,kFAWd;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,sBAEC;IAED;;OAEG;IACH,sBAEC;IAED;;OAEG;IACH,0BAEC;IAED;;OAEG;IACH,8BAEC;IAED;;OAEG;IACH,0BAEC;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,8BAEC;IAED;;OAEG;IACH,gCAEC;IAED;;OAEG;IACH,gCAGC;IAED;;OAEG;IACH,yBAEC;IAED;;;OAGG;IACH,wBAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,iFAFe,KAAK,GAAG;QAAC,MAAM,CAAC,EAAE,GAAG,CAAA;KAAC,KAAK,GAAG,QAI5C;IAED;;;;;;OAMG;IACH,kCALW,WAAW,GAAG,IAAI,iBAClB,WAAW,IAAI,gCAEb,MAAM,WAAW,CAAC,CAoI9B;IAED;;;;;;;OAOG;IACH,4BANW,MAAM,QACN,OAAO,GAAG,SAAS,GAAG,MAAM,UAC5B,OAAO,YACP,MAAM,GACJ,WAAW,IAAI,CAI3B;CACJ"} \ No newline at end of file diff --git a/core/custupCore.js b/core/custupCore.js index d0b9edf..29a140f 100644 --- a/core/custupCore.js +++ b/core/custupCore.js @@ -1904,7 +1904,7 @@ export default class CustUpCore extends EventTarget { attached_files.map(file => _class.file_upload_form_data.append(_class.options.file_upload_settings.files_field_name, file)) const all_files = [...this.selectedFiles, ...attached_files]; - const beforeUploadStartCheck = this.triggerEvent('upload_beforeStart', {files: all_files, formData: _class.file_upload_form_data, form: form_field}) + const beforeUploadStartCheck = this.triggerEvent('upload_beforeStart', {files: all_files, formData: _class.file_upload_form_data, form: this.get_attached_form_field()}) if (!beforeUploadStartCheck) { this.show_message("Please check that all requirements have been satisfied", "error"); return; @@ -1975,7 +1975,7 @@ export default class CustUpCore extends EventTarget { * @private @method get_attached_form_field */ get_attached_form_field () { - return !_class.options.file_upload_settings.form_field ? undefined : document.querySelector(_class.options.file_upload_settings.form_field); + return !this.options.file_upload_settings.form_field ? undefined : document.querySelector(this.options.file_upload_settings.form_field); } /** @@ -2144,7 +2144,7 @@ export default class CustUpCore extends EventTarget { * @method upload - the method to upload file to the endpoint * @param {string | undefined} file_id - the id of the file to upload in the case of a single file, all the files will be uploaded serially if not provided */ - upload (file_id) { + upload (file_id=undefined) { const file = this.selectedFiles.find(fl => fl.id == file_id) this.fileUploadHandler(file); } diff --git a/package.json b/package.json index c9169b7..a2aca5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "custup", - "version": "1.1.5", + "version": "1.1.6", "description": "Highly customisable file upload library with zero dependencies", "main": "src/custup.min.js", "scripts": {