From 78fa0c7e169276917c4877f1e6c6fa765aced96f Mon Sep 17 00:00:00 2001 From: winkidney Date: Mon, 11 Mar 2019 13:45:06 +0800 Subject: [PATCH] Feature: Add on-no-more method to enable "end" display --- pinry/static/js/vue/main.js | 7 +++++++ pinry/templates/core/pins.html | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pinry/static/js/vue/main.js b/pinry/static/js/vue/main.js index bdeeca3..45fdb55 100644 --- a/pinry/static/js/vue/main.js +++ b/pinry/static/js/vue/main.js @@ -199,6 +199,9 @@ Vue.component('pin-container', { this.$emit( "loaded", ); + if (!hasNext) { + this.$emit("no-more-pins") + } }, markAsLoading: function() { this.status.loading = true; @@ -294,6 +297,7 @@ var app = new Vue({ data() { return { loading: true, + noMore: false, } }, methods: { @@ -303,5 +307,8 @@ var app = new Vue({ onLoading: function(){ this.loading = true; }, + onNoMore: function () { + this.noMore = true; + } }, }); diff --git a/pinry/templates/core/pins.html b/pinry/templates/core/pins.html index 224a9d6..6ae4777 100644 --- a/pinry/templates/core/pins.html +++ b/pinry/templates/core/pins.html @@ -1,7 +1,12 @@ {% extends "base.html" %} {% block yield %} - - -
+ + +
+
— End —
{% endblock %}