add back to top for independent column

pull/433/head
maskeynihal 2023-06-09 13:30:12 +05:45
parent 97d1fafe18
commit 34b0ef1a6d
1 changed files with 10 additions and 1 deletions

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
<div class="footer"> <div class="footer">
<div class="container"> <div class="container">
<p> <p>
<a href="#top" class="button is-primary is-small">{{ $t('templates.footer.backToTop') }}</a> <button type="button" class="button is-primary is-small" @click="handleScrollToTop">{{ $t('templates.footer.backToTop') }}</button>
</p> </p>
<p> <p>
{{ $t('templates.footer.thisToolIs') }} {{ $t('templates.footer.thisToolIs') }}
@ -68,5 +68,14 @@ THE SOFTWARE.
components: { components: {
ExternalLink, ExternalLink,
}, },
methods: {
handleScrollToTop: () => {
window.scrollTo({top: 0});
const columns = document.querySelectorAll('.column-scroll-y');
columns.forEach(column => column.scrollTo({top: 0}));
},
},
}; };
</script> </script>