0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2025-01-05 15:11:13 +00:00

scroll back to top after clicking on a video

This commit is contained in:
Ethan 2022-03-22 01:37:23 -05:00
parent 6a98cf4f4a
commit efbbd9e6b1
2 changed files with 7 additions and 4 deletions

View file

@ -24,7 +24,7 @@
>
<!-- element above removes artifacting from things like v-ripple by -->
<!-- scrollbox below must be a standalone div -->
<div class="scroll-y" style="height: 100%">
<div class="scroll-y" ref="pgscroll" style="height: 100%">
<nuxt v-show="!search" />
</div>
</div>
@ -164,5 +164,11 @@ export default {
}
},
},
watch: {
$route() {
this.$refs.pgscroll.scrollTop = 0; // scroll back to top when moving to new route
}
}
};
</script>

View file

@ -119,9 +119,6 @@ export default {
};
},
mounted() {
// scroll back to top after clicking on the video
window.scroll(0, 0);
this.likes = 100;
this.$youtube.getVid(this.$route.query.v).then((result) => {