Commit ab8144f0 authored by Mark Florian's avatar Mark Florian

Merge branch '197927-attaching-multiple-files-to-a-wiki-page-doesn-t-work' into 'master'

Resolve "Attaching multiple files to a wiki page doesn't work"

See merge request gitlab-org/gitlab!29029
parents 8dba3133 dbbb2922
...@@ -23,7 +23,7 @@ function getErrorMessage(res) { ...@@ -23,7 +23,7 @@ function getErrorMessage(res) {
return res.message; return res.message;
} }
export default function dropzoneInput(form) { export default function dropzoneInput(form, config = { parallelUploads: 2 }) {
const divHover = '<div class="div-dropzone-hover"></div>'; const divHover = '<div class="div-dropzone-hover"></div>';
const iconPaperclip = '<i class="fa fa-paperclip div-dropzone-icon"></i>'; const iconPaperclip = '<i class="fa fa-paperclip div-dropzone-icon"></i>';
const $attachButton = form.find('.button-attach-file'); const $attachButton = form.find('.button-attach-file');
...@@ -69,6 +69,7 @@ export default function dropzoneInput(form) { ...@@ -69,6 +69,7 @@ export default function dropzoneInput(form) {
uploadMultiple: false, uploadMultiple: false,
headers: csrf.headers, headers: csrf.headers,
previewContainer: false, previewContainer: false,
...config,
processing: () => $('.div-dropzone-alert').alert('close'), processing: () => $('.div-dropzone-alert').alert('close'),
dragover: () => { dragover: () => {
$mdArea.addClass('is-dropzone-hover'); $mdArea.addClass('is-dropzone-hover');
......
...@@ -45,7 +45,7 @@ export default class GLForm { ...@@ -45,7 +45,7 @@ export default class GLForm {
); );
this.autoComplete = new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources); this.autoComplete = new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources);
this.autoComplete.setup(this.form.find('.js-gfm-input'), this.enableGFM); this.autoComplete.setup(this.form.find('.js-gfm-input'), this.enableGFM);
dropzoneInput(this.form); dropzoneInput(this.form, { parallelUploads: 1 });
autosize(this.textarea); autosize(this.textarea);
} }
// form and textarea event listeners // form and textarea event listeners
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment