From 82ddfe181df491507f90ca2bc0f0b77626f687af Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Thu, 8 Apr 2021 21:47:51 +0100 Subject: [PATCH 1/2] Fix Dropzone following #15315 #15315 appears to have caused a change in the way Dropzone is imported - and it now produces a module rather than the constructor. This PR rather hackily just adds another Dropzone call to the result. Signed-off-by: Andrew Thornton --- web_src/js/features/dropzone.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/dropzone.js b/web_src/js/features/dropzone.js index 428f1d677ab3a..355b7623e236e 100644 --- a/web_src/js/features/dropzone.js +++ b/web_src/js/features/dropzone.js @@ -4,6 +4,6 @@ export default async function createDropzone(el, opts) { import(/* webpackChunkName: "dropzone" */'dropzone/dist/dropzone.css'), ]); - Dropzone.autoDiscover = false; - return new Dropzone(el, opts); + Dropzone.Dropzone.autoDiscover = false; + return new Dropzone.Dropzone(el, opts); } From d9b9df0759d9a3d75ee84fc618ae72c7a65dee9e Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Apr 2021 23:49:13 +0200 Subject: [PATCH 2/2] use destructured export --- web_src/js/features/dropzone.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web_src/js/features/dropzone.js b/web_src/js/features/dropzone.js index 355b7623e236e..6a4f7e17e49ab 100644 --- a/web_src/js/features/dropzone.js +++ b/web_src/js/features/dropzone.js @@ -1,9 +1,9 @@ export default async function createDropzone(el, opts) { - const [{default: Dropzone}] = await Promise.all([ + const [{Dropzone}] = await Promise.all([ import(/* webpackChunkName: "dropzone" */'dropzone'), import(/* webpackChunkName: "dropzone" */'dropzone/dist/dropzone.css'), ]); - Dropzone.Dropzone.autoDiscover = false; - return new Dropzone.Dropzone(el, opts); + Dropzone.autoDiscover = false; + return new Dropzone(el, opts); }