aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-03-07 22:06:15 +0100
committerGitHub <noreply@github.com>2020-03-07 21:06:15 +0000
commit9d3e69e8677008384d159ee138515ff7498064d7 (patch)
tree6f4108b98bd665506315ce8dd41e2e66b0896a3d /web_src/js/features
parent0c2148c037c4bc23a802c7a5580e3fed336ebe3e (diff)
downloadgitea-9d3e69e8677008384d159ee138515ff7498064d7.tar.gz
gitea-9d3e69e8677008384d159ee138515ff7498064d7.zip
Move dropzone.js to npm/webpack (#10645)
- unvendor dropzone and upgrade it from 4.2.0 to 5.7.0 - make `csrf` available on window.config
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/dropzone.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/web_src/js/features/dropzone.js b/web_src/js/features/dropzone.js
new file mode 100644
index 0000000000..f5d5b36a18
--- /dev/null
+++ b/web_src/js/features/dropzone.js
@@ -0,0 +1,9 @@
+export default async function createDropzone(el, opts) {
+ const [{ default: Dropzone }] = await Promise.all([
+ import(/* webpackChunkName: "dropzone" */'dropzone'),
+ import(/* webpackChunkName: "dropzone" */'dropzone/dist/dropzone.css'),
+ ]);
+
+ Dropzone.autoDiscover = false;
+ return new Dropzone(el, opts);
+}