From a4b71c1707e381f88152e4324b6319fcd54794c4 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Mon, 19 Feb 2018 11:14:50 -0800 Subject: [PATCH] show attachments with thumbnails and remove button --- src/pages/stream/stream.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/pages/stream/stream.ts b/src/pages/stream/stream.ts index 75f8754..7415dc8 100644 --- a/src/pages/stream/stream.ts +++ b/src/pages/stream/stream.ts @@ -351,10 +351,14 @@ export class StreamPage { - + + -

filename

+

{{ f.name }}

+
@@ -365,6 +369,7 @@ export class NewPostModal { title: string; replyid: string; ptext: string = ""; + files: Array = []; 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({