Hide posting interface

This commit is contained in:
Peter Stuifzand 2018-12-29 21:56:25 +01:00
parent 502944f2ad
commit 39e4d272b6
2 changed files with 20 additions and 6 deletions

View File

@ -50,6 +50,7 @@
}, },
}).then(() => { }).then(() => {
this.newPost = ''; this.newPost = '';
this.$emit('close')
}) })
}, },
} }

View File

@ -7,9 +7,20 @@
</Channels> </Channels>
<div class="timeline column is-three-fifths"> <div class="timeline column is-three-fifths">
<button class="button" @click="openFeedFollower">Add feed</button> <div class="level">
<new-post class="mt-20"></new-post> <div class="level-left">
<h1 class="title is-5 mt-20">{{ channel.name }}</h1> <h1 class="title is-5">{{ channel.name }}</h1>
</div>
<div class="level-right">
<div class="level-item">
<button class="button" @click.prevent="openPost">New Post</button>
</div>
<div class="level-item">
<button class="button" @click.prevent="openFeedFollower('')">Add feed</button>
</div>
</div>
</div>
<new-post class="mt-20" v-if="showPost" @close="showPost = false"></new-post>
<Timeline style="margin-top:20px" :timeline="this.$store.state.timeline" :channel="channel" <Timeline style="margin-top:20px" :timeline="this.$store.state.timeline" :channel="channel"
@getPage="getPage" @followFeed="openFeedFollower(arguments[0])"></Timeline> @getPage="getPage" @followFeed="openFeedFollower(arguments[0])"></Timeline>
</div> </div>
@ -43,7 +54,8 @@
data() { data() {
return { return {
feedFollowerIsOpen: false, feedFollowerIsOpen: false,
feedFollowerQuery: '' feedFollowerQuery: '',
showPost: false
} }
}, },
@ -58,8 +70,6 @@
methods: { methods: {
openFeedFollower(query) { openFeedFollower(query) {
// eslint-disable-next-line
console.log(query)
this.feedFollowerIsOpen = true this.feedFollowerIsOpen = true
this.feedFollowerQuery = query this.feedFollowerQuery = query
}, },
@ -77,6 +87,9 @@
this.$store.dispatch('fetchTimeline', next).then(() => { this.$store.dispatch('fetchTimeline', next).then(() => {
window.scrollTo({top: 0}) window.scrollTo({top: 0})
}) })
},
openPost() {
this.showPost = true
} }
}, },