Scroll to top when pagination switches

This commit is contained in:
Joel Collins 2020-11-11 14:10:20 +00:00
parent 64aa565182
commit fa909db71c
2 changed files with 10 additions and 0 deletions

View file

@ -134,7 +134,9 @@
:prev-text="'Prev'" :prev-text="'Prev'"
:next-text="'Next'" :next-text="'Next'"
:page-class="'page-item'" :page-class="'page-item'"
:active-class="'uk-active'"
:disabled-class="'uk-disabled'" :disabled-class="'uk-disabled'"
:click-handler="scrollToTop()"
> >
</Paginate> </Paginate>
</div> </div>
@ -339,6 +341,10 @@ export default {
}, },
methods: { methods: {
scrollToTop() {
document.querySelector("#container-left").scrollTop = 0;
},
updateCaptures: function() { updateCaptures: function() {
if (this.$store.state.available) { if (this.$store.state.available) {
console.log("Updating capture list..."); console.log("Updating capture list...");

View file

@ -62,6 +62,7 @@
:page-class="'page-item'" :page-class="'page-item'"
:active-class="'uk-active'" :active-class="'uk-active'"
:disabled-class="'uk-disabled'" :disabled-class="'uk-disabled'"
:click-handler="scrollToTop()"
> >
</Paginate> </Paginate>
</div> </div>
@ -109,6 +110,9 @@ export default {
}, },
methods: { methods: {
scrollToTop() {
document.querySelector("#container-left").scrollTop = 0;
},
visibilityChanged(isVisible) { visibilityChanged(isVisible) {
if (isVisible) { if (isVisible) {
this.updateLogs(); this.updateLogs();