Fixed scroll to top.

This commit is contained in:
DebaucheryLibrarian
2021-01-17 21:24:20 +01:00
parent 8bc1fbf530
commit dd5284c55a
35 changed files with 52 additions and 34 deletions

View File

@@ -20,8 +20,11 @@
@show-filters="(state) => toggleFilters(state)"
/>
<div class="content">
<router-view />
<div
ref="content"
class="content"
>
<router-view @scroll="scrollToTop" />
</div>
<Filters
@@ -68,6 +71,10 @@ function resize(event) {
this.events.emit('resize', event);
}
function scrollToTop() {
this.$refs.content.scrollTop = 0;
}
function mounted() {
document.addEventListener('click', this.blur);
window.addEventListener('resize', this.resize);
@@ -100,6 +107,7 @@ export default {
setConsent,
blur,
resize,
scrollToTop,
},
};
</script>