From d0006e4d54cfb77d02a572645cc83d0779f7ef8b Mon Sep 17 00:00:00 2001 From: pk Date: Tue, 15 Nov 2022 20:12:51 +0100 Subject: [PATCH] Add before event to upload files mixin --- upload-files.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upload-files.js b/upload-files.js index 175e460..33abf2a 100644 --- a/upload-files.js +++ b/upload-files.js @@ -36,6 +36,8 @@ export const upload = function(superClass) { formData.append(files[i].name, files[i]); } + document.dispatchEvent(new CustomEvent('before-request', { detail: request, bubbles: true, composed: true })); + request.send(formData); }); }