summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-04-27 20:40:45 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-04-27 20:40:45 +0000
commit9243a5ffaa67c1fd77a0c77e656416646989f9e8 (patch)
tree9f40a6a67e05aae266fc0597d4860a5e29f1361b /public
parentd4874f303eca4aa2b13c8f4939d53ffa0265a1fc (diff)
downloadredmine-9243a5ffaa67c1fd77a0c77e656416646989f9e8.tar.gz
redmine-9243a5ffaa67c1fd77a0c77e656416646989f9e8.zip
Use closest form when copy image from clipboard (#36817).
Patch by Yazan Al aeddin. git-svn-id: https://svn.redmine.org/redmine/trunk@21540 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/attachments.js3
1 files changed, 2 insertions, 1 deletions
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);
}