mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore(sceneries): added preserving scroll state in the stations table after leaving the view
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section class="station_table">
|
||||
<section class="station_table" @scroll="onScroll" ref="tableRef">
|
||||
<Loading
|
||||
v-if="apiStore.dataStatuses.connection == Status.Loading && filteredStationList.length == 0"
|
||||
/>
|
||||
@@ -363,7 +363,8 @@ export default defineComponent({
|
||||
data: () => ({
|
||||
headIconsIds,
|
||||
headIds,
|
||||
getChangedFilters
|
||||
getChangedFilters,
|
||||
scrollTop: 0
|
||||
}),
|
||||
|
||||
setup() {
|
||||
@@ -391,6 +392,10 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
|
||||
activated() {
|
||||
(this.$refs['tableRef'] as HTMLElement).scrollTop = this.scrollTop;
|
||||
},
|
||||
|
||||
methods: {
|
||||
getSceneryRoute(station: Station) {
|
||||
this.$router.push({
|
||||
@@ -431,6 +436,10 @@ export default defineComponent({
|
||||
}));
|
||||
|
||||
return JSON.stringify(usersTrains);
|
||||
},
|
||||
|
||||
onScroll(e: Event) {
|
||||
this.scrollTop = (e.target as HTMLElement).scrollTop;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user