Compare commits
3 Commits
48e727b2eb
...
2ace99f75d
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ace99f75d | |||
| f51f643bfa | |||
| 63fc43fb27 |
|
|
@ -27,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="title is-6" v-if="currentItem.name" v-text="currentItem.name"></h3>
|
<h3 class="title is-6" v-if="currentItem.name" v-text="currentItem.name"></h3>
|
||||||
<div class="content" v-html="main_content"></div>
|
<div class="content is-pre" v-html="main_content"></div>
|
||||||
|
|
||||||
<div class="photos">
|
<div class="photos">
|
||||||
<div class="photo" v-for="photo in photo_rest" :key="photo">
|
<div class="photo" v-for="photo in photo_rest" :key="photo">
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.entry.unread {
|
.entry.unread {
|
||||||
outline: 1px solid #ccc;
|
border-color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media .entry {
|
.media .entry {
|
||||||
|
|
@ -286,4 +286,7 @@
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-gap: 4px;
|
grid-gap: 4px;
|
||||||
}
|
}
|
||||||
|
.is-pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -58,6 +58,8 @@
|
||||||
return this.$store.dispatch('markRead', {channel: channel, entry: item._id})
|
return this.$store.dispatch('markRead', {channel: channel, entry: item._id})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
item._is_read = true
|
item._is_read = true
|
||||||
|
}).then(() => {
|
||||||
|
this.$store.dispatch('fetchChannels')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
|
|
|
||||||
|
|
@ -175,15 +175,20 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
bottomReached() {
|
bottomReached() {
|
||||||
let count = 0
|
let count = 0
|
||||||
this.state.timeline.items.forEach((item) => {
|
let uids = []
|
||||||
|
let items = this.state.timeline.items
|
||||||
|
uids = _.map(_.filter(items, item => !item._is_read), item => item._id)
|
||||||
|
items.forEach((item) => {
|
||||||
if (item && !item._is_read) {
|
if (item && !item._is_read) {
|
||||||
item._is_read = true
|
item._is_read = true
|
||||||
this.dispatch('markRead', {channel: this.state.channel.uid, entry: item._id})
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
this.dispatch('markRead', {channel: this.state.channel.uid, 'entry[]': uids})
|
||||||
|
.then(() => {
|
||||||
this.dispatch('fetchChannels')
|
this.dispatch('fetchChannels')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startEventListening({commit}, url) {
|
startEventListening({commit}, url) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user