Splatfest history dialog: scroll to the top when changing regions

This commit is contained in:
Matt Isenhower
2018-02-03 11:53:56 -08:00
parent 3f9d65f308
commit 1249643445

View File

@@ -17,7 +17,7 @@
</div>
</div>
<div class="modal-card-body">
<div class="modal-card-body" ref="body">
<div v-for="(info, index) in festivals" class="splatfest-history-row" :key="info.festival.festival_id">
<div class="level">
<div class="level-item">
@@ -81,6 +81,11 @@ export default {
});
},
},
watch: {
region() {
this.scrollToTop();
},
},
created() {
if (this.initialRegion)
this.region = this.initialRegion;
@@ -88,5 +93,10 @@ export default {
mounted() {
analytics.event('Splatfest History', 'Open');
},
methods: {
scrollToTop() {
this.$refs.body.scrollTop = 0;
},
},
}
</script>