Commit a4b71c17 authored by Morgan McMillian's avatar Morgan McMillian

show attachments with thumbnails and remove button

parent e3b4109d
......@@ -351,10 +351,14 @@ export class StreamPage {
</ion-col>
</ion-row>
<ion-list>
<ion-item>
<ion-item *ngFor="let f of files">
<ion-thumbnail item-start>
<img src="{{ f.link }}">
</ion-thumbnail>
<p>filename</p>
<p>{{ f.name }}</p>
<button ion-button color="dark" clear item-end (click)="unattach(f.id)">
<ion-icon name="remove-circle"></ion-icon>
</button>
</ion-item>
</ion-list>
</ion-card>
......@@ -365,6 +369,7 @@ export class NewPostModal {
title: string;
replyid: string;
ptext: string = "";
files: Array<Object> = [];
fname: string = "";
fpath: string = "";
options: Object = {};
......@@ -515,6 +520,11 @@ export class NewPostModal {
type: "io.pnut.core.oembed",
value: oembed
});
this.files.push({
name: this.fname,
link: rdata.data.link,
id: this.raw.length - 1
});
}).catch((err) => {
console.log('-create file error-');
console.log(JSON.stringify(err));
......@@ -531,6 +541,12 @@ export class NewPostModal {
});
}
unattach(id) {
console.log('removing item ' + id);
this.raw.splice(id, 1);
this.files.splice(id, 1);
}
}
@Component({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment