diff options
Diffstat (limited to 'app/assets/javascripts/dropzone_input.js')
-rw-r--r-- | app/assets/javascripts/dropzone_input.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 0e2dd59092a..6c158ad8990 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -6,6 +6,7 @@ import PasteMarkdownTable from './behaviors/markdown/paste_markdown_table'; import csrf from './lib/utils/csrf'; import axios from './lib/utils/axios_utils'; import { n__, __ } from '~/locale'; +import { getFilename } from '~/lib/utils/file_upload'; Dropzone.autoDiscover = false; @@ -41,7 +42,6 @@ export default function dropzoneInput(form) { let addFileToForm; let updateAttachingMessage; let isImage; - let getFilename; let uploadFile; formTextarea.wrap('<div class="div-dropzone"></div>'); @@ -235,17 +235,6 @@ export default function dropzoneInput(form) { $(form).append(`<input type="hidden" name="files[]" value="${_.escape(path)}">`); }; - getFilename = e => { - let value; - if (window.clipboardData && window.clipboardData.getData) { - value = window.clipboardData.getData('Text'); - } else if (e.clipboardData && e.clipboardData.getData) { - value = e.clipboardData.getData('text/plain'); - } - value = value.split('\r'); - return value[0]; - }; - const showSpinner = () => $uploadingProgressContainer.removeClass('hide'); const closeSpinner = () => $uploadingProgressContainer.addClass('hide'); |