diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 1440f4c..41de5c9 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -951,28 +951,29 @@ Create a message containing the uploaded attachment li.click (event) => @_insert(event) filename = li.data 'filename' + internalFileID = li.data 'internalFileID' - if data.returnValues and data.returnValues.attachments[filename] - if data.returnValues.attachments[filename].tinyURL - li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") + if data.returnValues and data.returnValues.attachments[internalFileID] + if data.returnValues.attachments[internalFileID].tinyURL + li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") link = $ '' - link.attr {'href': data.returnValues.attachments[filename].url, 'title': filename} + link.attr {'href': data.returnValues.attachments[internalFileID].url, 'title': filename} - unless parseInt(data.returnValues.attachments[filename].isImage) is 0 + unless parseInt(data.returnValues.attachments[internalFileID].isImage) is 0 link.addClass('jsImageViewer') - if !data.returnValues.attachments[filename].tinyURL - li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") + if !data.returnValues.attachments[internalFileID].tinyURL + li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") li.find('.attachmentTinyThumbnail').wrap link - li.find('small').append data.returnValues.attachments[filename].formattedFilesize + li.find('small').append data.returnValues.attachments[internalFileID].formattedFilesize - li.data 'objectID', data.returnValues.attachments[filename].attachmentID + li.data 'objectID', data.returnValues.attachments[internalFileID].attachmentID deleteButton = $ """