Commit a5ff6879 authored by Morgan McMillian's avatar Morgan McMillian

Add overflow menu to the thread view, issue #39

parent 83d1ff25
......@@ -201,7 +201,7 @@ export class StreamPage {
fetchThread(threadid) {
pnut.thread(threadid, {include_deleted: 0, include_raw: 1, count: 140}).then(res => {
this.navCtrl.push(ThreadPage, {posts: res.data});
this.navCtrl.push(ThreadPage, {posts: res.data, me: this.myUsername});
}).catch(err => {
console.log(err);
});
......
......@@ -69,17 +69,11 @@
<div *ngIf="post.counts.reposts > 0">{{ post.counts.reposts }}</div>
</button>
</ion-col>
<!-- <ion-col>
<button ion-button icon-left clear small block>
<ion-icon name="chatboxes"></ion-icon>
<div *ngIf="post.counts.replies > 0">{{ post.counts.replies }}</div>
</button>
</ion-col> -->
<!-- <ion-col>
<button ion-button icon-left clear small block>
<ion-col>
<button ion-button icon-left clear small block (click)="presentPostMenu($event, post)">
<ion-icon name="more"></ion-icon>
</button>
</ion-col> -->
</ion-col>
</ion-row>
</ion-card>
</ion-list>
......
import { Component } from '@angular/core';
import { NavController, NavParams, ModalController, ToastController } from 'ionic-angular';
import { NewPostModal } from '../stream/stream';
import { NavController, NavParams, ModalController, ToastController, PopoverController } from 'ionic-angular';
import { NewPostModal, PostMenu } from '../stream/stream';
import * as pnut from 'pnut-butter';
......@@ -18,10 +18,12 @@ export class ThreadPage {
title: string;
posts: Array<Object> = [];
myUsername: string;
constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController,
public toastCtrl: ToastController) {
public popoverCtrl: PopoverController, public toastCtrl: ToastController) {
this.posts = this.navParams.data.posts;
this.myUsername = this.navParams.data.me;
}
showReplyPost(postData) {
......@@ -88,6 +90,11 @@ export class ThreadPage {
});
}
presentPostMenu(myEvent, postData) {
let popover = this.popoverCtrl.create(PostMenu, {post: postData, me: this.myUsername});
popover.present({ev: myEvent});
}
presentToast(text) {
let toast = this.toastCtrl.create({
position: 'top',
......
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