fix up thumbnail rendering

This commit is contained in:
Morgan McMillian 2018-11-21 06:39:22 -08:00
parent 4261fcda94
commit 3ac8ad780f

View file

@ -29,22 +29,41 @@
</ion-card-content>
<div *ngIf="post.raw">
<div *ngFor="let r of post.raw">
<ion-list *ngFor="let r of post.raw">
<div *ngIf="r.type == 'io.pnut.core.oembed'">
<ion-item>
<div *ngIf="hideImg; then imgbtn else thumbnail"></div>
<ng-template #imgbtn >
<div *ngIf="hideImg; then hidebtn else thumbbtn"></div>
<ng-template #thumbbtn>
<ion-item>
<ion-thumbnail item-start>
<img src="{{ r.value.thumbnail_url || r.value.url }}" (click)="showImage(r.value.url)">
</ion-thumbnail>
<h2>{{ r.value.title }}</h2>
<p>{{ r.value.description }}</p>
</ion-item>
</ng-template>
<ng-template #hidebtn>
<ion-item>
<button ion-button icon-start (click)="showImage(r.value.url)">
<ion-icon name="image"></ion-icon>
{{ r.value.title }}
</button>
</ng-template>
<ng-template #thumbnail >
<img src="{{ r.value.thumbnail_url || r.value.url }}" (click)="showImage(r.value.url)">
</ng-template>
</ion-item>
<p>{{ r.value.description }}</p>
</ion-item>
</ng-template>
<!-- <div *ngIf="!hideImg; else imgbtn"> -->
<!-- </div>
<ng-template #hideImg>
<ion-item>
<button ion-button icon-start (click)="showImage(r.value.url)">
<ion-icon name="image"></ion-icon>
{{ r.value.title }}
</button>
<p>{{ r.value.description }}</p>
</ion-item>
</ng-template> -->
</div>
</div>
</ion-list>
</div>
<div *ngIf="post.reposted_by_string">