From d302f778be5b7412c579af8eef1b44194e98005b Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 11 Dec 2019 09:06:51 +0000 Subject: Fixes image pasting for Edge (#3816, #32552, #32596). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@19356 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/attachments.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'public/javascripts') 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); -- cgit v1.2.3