mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-10 14:57:00 +00:00
Responsive widths + Continuations.
This commit is contained in:
parent
53cf9b30fe
commit
8536b4a9f3
@ -36,7 +36,7 @@
|
|||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div uk-grid>
|
<div uk-grid>
|
||||||
<div class="uk-width-4-5" v-if="comments">
|
<div class="uk-width-4-5@xl uk-width-3-4@l uk-width-2-3" v-if="comments">
|
||||||
<div
|
<div
|
||||||
class="uk-tile-default uk-align-left uk-width-expand"
|
class="uk-tile-default uk-align-left uk-width-expand"
|
||||||
style="background: #0b0e0f"
|
style="background: #0b0e0f"
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-width-1-5" v-if="video">
|
<div class="uk-width-1-5@xl uk-width-1-4@l uk-width-1-3" v-if="video">
|
||||||
<div
|
<div
|
||||||
class="uk-tile-default uk-width-auto"
|
class="uk-tile-default uk-width-auto"
|
||||||
style="background: #0b0e0f"
|
style="background: #0b0e0f"
|
||||||
@ -107,6 +107,10 @@ export default {
|
|||||||
this.getVideoData();
|
this.getVideoData();
|
||||||
this.getSponsors();
|
this.getSponsors();
|
||||||
this.getComments();
|
this.getComments();
|
||||||
|
window.addEventListener("scroll", this.handleScroll);
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"$route.query.v": function(v) {
|
"$route.query.v": function(v) {
|
||||||
@ -161,6 +165,23 @@ export default {
|
|||||||
async getComments() {
|
async getComments() {
|
||||||
this.fetchComments().then(data => (this.comments = data));
|
this.fetchComments().then(data => (this.comments = data));
|
||||||
},
|
},
|
||||||
|
handleScroll() {
|
||||||
|
if (this.loading || !this.comments || !this.comments.nextpage) return;
|
||||||
|
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) {
|
||||||
|
this.loading = true;
|
||||||
|
this.fetchJson(
|
||||||
|
Constants.BASE_URL +
|
||||||
|
"/nextpage/comments/" +
|
||||||
|
this.$route.query.v +
|
||||||
|
"?url=" +
|
||||||
|
encodeURIComponent(this.comments.nextpage),
|
||||||
|
).then(json => {
|
||||||
|
this.comments.nextpage = json.nextpage;
|
||||||
|
this.loading = false;
|
||||||
|
json.comments.map(comment => this.comments.comments.push(comment));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Player,
|
Player,
|
||||||
|
Loading…
Reference in New Issue
Block a user