From: Marius Balteanu Date: Thu, 28 Apr 2022 05:36:38 +0000 (+0000) Subject: Merged r21540 to 5.0-stable (#36817). X-Git-Tag: 5.0.1~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f9fd7c02a0182391f157b32a07eacd0a7e866ee8;p=redmine.git Merged r21540 to 5.0-stable (#36817). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21544 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 76d75d6e2..b7c42aa8a 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -289,7 +289,8 @@ function copyImageFromClipboard(e) { + '-' + randomKey(5).toLocaleLowerCase() + '.' + file.name.split('.').pop(); - var inputEl = $('input:file.filedrop').first() + // get input file in the closest form + var inputEl = $(this).closest("form").find('input:file.filedrop'); handleFileDropEvent.target = e.target; addFile(inputEl, new File([file], filename, { type: file.type }), true); }