Skip to content

Commit

Permalink
separates collapse check for media
Browse files Browse the repository at this point in the history
  • Loading branch information
c0dzilla committed May 1, 2018
1 parent 96fee47 commit 0af5f82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,24 @@
</div>
{{/if}}

<div class="attachment-flex">
{{#if thumb_url}}
<div class="attachment-thumb">
<img src="{{fixCordova thumb_url}}">
</div>
{{/if}}
{{#unless collapsed}}
<div class="attachment-flex">
{{#if thumb_url}}
<div class="attachment-thumb">
<img src="{{fixCordova thumb_url}}">
</div>
{{/if}}

{{#if text}}
<div class="attachment-flex-column-grow attachment-text">
{{{parsedText}}}
</div>
{{/if}}
</div>
{{#if text}}
<div class="attachment-flex-column-grow attachment-text">
{{{parsedText}}}
</div>
{{/if}}
</div>
{{/unless}}

{{#if image_url}}
{{#unless collapsed}}
{{#unless mediaCollapsed}}
<div class="attachment-image">
{{#if loadImage}}
<figure>
Expand Down Expand Up @@ -89,7 +91,7 @@
{{/if}}

{{#if audio_url}}
{{#unless collapsed}}
{{#unless mediaCollapsed}}
<div class="attachment-audio">
<audio controls>
<source src="{{fixCordova audio_url}}" type="{{audio_type}}" data-description="{{description}}">
Expand All @@ -100,7 +102,7 @@
{{/if}}

{{#if video_url}}
{{#unless collapsed}}
{{#unless mediaCollapsed}}
<div class="attachment-video">
<video controls class="inline-video">
<source src="{{fixCordova video_url}}" type="{{video_type}}" data-description="{{description}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Template.messageAttachment.helpers({
return colors[this.color] || this.color;
},
collapsed() {
if (this.collapsed != null) {
return this.collapsed;
}
return false;
},
mediaCollapsed() {
if (this.collapsed != null) {
return this.collapsed;
} else {
Expand Down

0 comments on commit 0af5f82

Please sign in to comment.