mirror of
https://github.com/pinry/pinry.git
synced 2025-11-17 18:30:39 +01:00
Feature: Add on-no-more method to enable "end" display
This commit is contained in:
committed by
Isaac Bythewood
parent
dfcd3f64d5
commit
78fa0c7e16
@@ -199,6 +199,9 @@ Vue.component('pin-container', {
|
|||||||
this.$emit(
|
this.$emit(
|
||||||
"loaded",
|
"loaded",
|
||||||
);
|
);
|
||||||
|
if (!hasNext) {
|
||||||
|
this.$emit("no-more-pins")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
markAsLoading: function() {
|
markAsLoading: function() {
|
||||||
this.status.loading = true;
|
this.status.loading = true;
|
||||||
@@ -294,6 +297,7 @@ var app = new Vue({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
|
noMore: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -303,5 +307,8 @@ var app = new Vue({
|
|||||||
onLoading: function(){
|
onLoading: function(){
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
},
|
},
|
||||||
|
onNoMore: function () {
|
||||||
|
this.noMore = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block yield %}
|
{% block yield %}
|
||||||
<pin-container v-on:loaded="onLoaded()" v-on:loading="onLoading()">
|
<pin-container
|
||||||
</pin-container>
|
v-on:loaded="onLoaded()"
|
||||||
<div v-show="loading" class="spinner"></div>
|
v-on:loading="onLoading()"
|
||||||
|
v-on:no-more-pins="onNoMore()"
|
||||||
|
>
|
||||||
|
</pin-container>
|
||||||
|
<div v-show="loading" class="spinner"></div>
|
||||||
|
<div v-show="noMore">— End —</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user