X-Git-Url: https://git.auder.net/pieces/Cwda/n_black_bishop.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FNews.vue;h=a4ce579826fea3412338ec9e5f7b30cab791c29c;hb=68e3aa8c7a92efe3461bfc5c904f9763bca5d2da;hp=0e3c3c7ae08d18811849d5ee6d0898d25ebd902e;hpb=0234201fb338fc239d6f613c677fa932c7c3697c;p=vchess.git diff --git a/client/src/views/News.vue b/client/src/views/News.vue index 0e3c3c7a..a4ce5798 100644 --- a/client/src/views/News.vue +++ b/client/src/views/News.vue @@ -26,10 +26,10 @@ main :class="{margintop:idx>0}" ) span.ndt {{ formatDatetime(n.added) }} - div(v-if="devs.includes(st.user.id)") + .dev-buttons(v-if="devs.includes(st.user.id)") button(@click="editNews(n)") {{ st.tr["Edit"] }} button(@click="deleteNews(n)") {{ st.tr["Delete"] }} - p(v-html="parseHtml(n.content)") + .news-content(v-html="parseHtml(n.content)") button#loadMoreBtn( v-if="hasMore" @click="loadMore()" @@ -68,6 +68,7 @@ export default { this.newsList = res.newsList; const L = res.newsList.length; if (L > 0) this.cursor = res.newsList[L - 1].added; + else this.hasMore = false; } } ); @@ -169,10 +170,10 @@ export default { { data: { cursor: this.cursor }, success: (res) => { - if (res.newsList.length > 0) { + const L = res.newsList.length; + if (L > 0) { this.newsList = this.newsList.concat(res.newsList); - const L = res.newsList.length; - if (L > 0) this.cursor = res.newsList[L - 1].added; + this.cursor = res.newsList[L - 1].added; } else this.hasMore = false; } } @@ -182,7 +183,7 @@ export default { }; -