makes image upload previews work in chrome

This commit is contained in:
Hannes Mannerheim 2016-01-23 17:27:41 +01:00
parent 9efd552de6
commit 755f3a78b7

View File

@ -3874,10 +3874,10 @@ function uploadAttachment(e, thisUploadButton) {
if (rsp.attr('stat') == 'ok') { if (rsp.attr('stat') == 'ok') {
// maybe add thumbnail below queet box // maybe add thumbnail below queet box
if($(data).find('atom\\:link').length>0) { if($(data).find('atom\\:link,link').length>0) {
var mimeType = $(data).find('atom\\:link').attr('type'); var mimeType = $(data).find('atom\\:link,link').attr('type');
if(mimeType.indexOf('image/') == 0) { if(mimeType.indexOf('image/') == 0) {
var imgUrl = $(data).find('atom\\:link').attr('href'); var imgUrl = $(data).find('atom\\:link,link').attr('href');
thisUploadButton.closest('.queet-toolbar').before('<span class="upload-image-container"><img class="to-upload" src="' + imgUrl + '" /></span>'); thisUploadButton.closest('.queet-toolbar').before('<span class="upload-image-container"><img class="to-upload" src="' + imgUrl + '" /></span>');
} }
} }