Skip to content
Snippets Groups Projects
Commit 476542a4 authored by Bradley Hilton's avatar Bradley Hilton Committed by Rodrigo Nascimento
Browse files

Fix the image urls not loading except for uploaded files (#6424)

parent eb066f1e
No related branches found
No related tags found
No related merge requests found
# History
## NEXT
- [FIX] Images on attachments were not loading except for uploaded files.
## 0.54.0 - 2017-Mar-22
### Meteor update to 1.4.3.1
......
......@@ -61,18 +61,3 @@ Template.messageAttachment.helpers
injectIndex: (data, previousIndex, index) ->
data.index = previousIndex + '.attachments.' + index
return
safeLoadImageAttachment: (url) ->
host = ''
url = fixCordova(url)
if url.indexOf("://") > -1
host = url.split('/')[2]
else
host = url.split('/')[0]
host = host.split(':')[0]
if host != window.location.hostname
return ''
else
return url
......@@ -66,8 +66,8 @@
<div class="attachment-image">
{{#if loadImage}}
<figure>
<div class="inline-image" style="background-image: url('{{safeLoadImageAttachment image_url}}');">
<img src="{{safeLoadImageAttachment image_url}}" height="{{getImageHeight image_dimensions.height}}" class="gallery-item" data-title="{{title}}" data-description="{{description}}">
<div class="inline-image" style="background-image: url('{{fixCordova image_url}}');">
<img src="{{fixCordova image_url}}" height="{{getImageHeight image_dimensions.height}}" class="gallery-item" data-title="{{title}}" data-description="{{description}}">
</div>
{{#if description}}
<figcaption class="attachment-description">{{description}}</figcaption>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment