summaryrefslogtreecommitdiffstats
path: root/public/javascripts
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-12-11 09:06:51 +0000
committerGo MAEDA <maeda@farend.jp>2019-12-11 09:06:51 +0000
commitd302f778be5b7412c579af8eef1b44194e98005b (patch)
tree4996afb18a47164ce2341d51f816ee774c2263f2 /public/javascripts
parent454ca7469a3b5e933aeb5cd505dbce40b419bd29 (diff)
downloadredmine-d302f778be5b7412c579af8eef1b44194e98005b.tar.gz
redmine-d302f778be5b7412c579af8eef1b44194e98005b.zip
Fixes image pasting for Edge (#3816, #32552, #32596).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@19356 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts')
-rw-r--r--public/javascripts/attachments.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 4a33daf55..053ef076a 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -103,7 +103,7 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
}, options);
uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
- if (blob instanceof window.File) {
+ if (blob instanceof window.Blob) {
uploadUrl += '&filename=' + encodeURIComponent(blob.name);
uploadUrl += '&content_type=' + encodeURIComponent(blob.type);
}
@@ -271,7 +271,8 @@ function copyImageFromClipboard(e) {
+ ('0'+date.getMinutes()).slice(-2)
+ '-' + randomKey(5).toLocaleLowerCase()
+ '.' + blob.name.split('.').pop();
- var file = new File([blob], filename, {type: blob.type});
+ var file = new Blob([blob], {type: blob.type});
+ file.name = filename;
var inputEl = $('input:file.filedrop').first()
handleFileDropEvent.target = e.target;
addFile(inputEl, file, true);