From aae51d4139c731e7abc2ec7f488bc30365a77e5f Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 27 Aug 2022 14:04:02 +0200 Subject: [PATCH] Hotfix --- src/components/TrainsView/TrainTable.vue | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index 6aacbc5..b42ac36 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -30,72 +30,64 @@ import modalTrainMixin from '../../mixins/modalTrainMixin'; import returnBtnMixin from '../../mixins/returnBtnMixin'; import Train from '../../scripts/interfaces/Train'; import { useStore } from '../../store/store'; +import Loading from '../Global/Loading.vue'; +import TrainInfo from './TrainInfo.vue'; export default defineComponent({ + components: { Loading, TrainInfo }, + props: { trains: { type: Array as PropType, required: true, }, }, - mixins: [returnBtnMixin, modalTrainMixin], - setup(props) { const store = useStore(); - const searchedTrain = inject('searchedTrain') as Ref; const searchedDriver = inject('searchedDriver') as Ref; - const currentTrains = computed(() => { return props.trains; }); - return { searchedTrain, searchedDriver, currentTrains, store, - sorterActive: inject('sorterActive') as { id: string | number; dir: number }, + sorterActive: inject('sorterActive') as { + id: string | number; + dir: number; + }, distanceLimitExceeded: computed( () => props.trains.findIndex(({ timetableData }) => timetableData && timetableData.routeDistance > 200) != -1 ), }; }, - activated() { const query = this.$route.query; - if (query.trainNo && query.driverName) { this.searchedDriver = query.driverName.toString(); this.searchedTrain = query.trainNo.toString(); - setTimeout(() => { this.selectModalTrain(query.driverName! + query.trainNo!.toString()); }, 20); } }, - methods: { enter(el: HTMLElement) { const maxHeight = getComputedStyle(el).height; - el.style.height = '0px'; - getComputedStyle(el); - setTimeout(() => { el.style.height = maxHeight; }, 10); }, - afterEnter(el: HTMLElement) { el.style.height = 'auto'; }, - leave(el: HTMLElement) { el.style.height = getComputedStyle(el).height; - setTimeout(() => { el.style.height = '0px'; }, 10);