mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-02 21:08:12 +00:00
chore: hiding entry details on history change
This commit is contained in:
@@ -165,6 +165,7 @@ export default defineComponent({
|
|||||||
.details-actions {
|
.details-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
|
margin-top: 1em;
|
||||||
|
|
||||||
button img {
|
button img {
|
||||||
height: 1.25em;
|
height: 1.25em;
|
||||||
|
|||||||
@@ -27,12 +27,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, PropType } from 'vue';
|
import { defineComponent, PropType } from 'vue';
|
||||||
import { API } from '../../../typings/api';
|
import { API } from '../../../typings/api';
|
||||||
import trainCategoryMixin from '../../../mixins/trainCategoryMixin';
|
|
||||||
import dateMixin from '../../../mixins/dateMixin';
|
|
||||||
import { useApiStore } from '../../../store/apiStore';
|
import { useApiStore } from '../../../store/apiStore';
|
||||||
import { Journal } from '../typings';
|
import { Journal } from '../typings';
|
||||||
|
|
||||||
|
import trainCategoryMixin from '../../../mixins/trainCategoryMixin';
|
||||||
|
import dateMixin from '../../../mixins/dateMixin';
|
||||||
import styleMixin from '../../../mixins/styleMixin';
|
import styleMixin from '../../../mixins/styleMixin';
|
||||||
|
|
||||||
import EntryGeneral from './EntryGeneral.vue';
|
import EntryGeneral from './EntryGeneral.vue';
|
||||||
import EntryStatus from './EntryStatus.vue';
|
import EntryStatus from './EntryStatus.vue';
|
||||||
import EntryDetails from './EntryDetails.vue';
|
import EntryDetails from './EntryDetails.vue';
|
||||||
@@ -126,7 +127,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggleExtraInfo() {
|
toggleExtraInfo() {
|
||||||
this.$emit('toggleShowExtraInfo', this.timetableEntry.id);
|
this.$emit('toggleShowExtraInfo');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<ul v-else class="journal-list">
|
<ul v-else class="journal-list">
|
||||||
<transition-group name="list-anim">
|
<transition-group name="list-anim">
|
||||||
<JournalTimetableEntry
|
<JournalTimetableEntry
|
||||||
v-for="timetableEntry in timetableHistory"
|
v-for="(timetableEntry, i) in timetableHistory"
|
||||||
:key="timetableEntry.id"
|
:key="timetableEntry.id"
|
||||||
:timetableEntry="timetableEntry"
|
:timetableEntry="timetableEntry"
|
||||||
:onToggleShowExtraInfo="toggleExtraInfo"
|
:onToggleShowExtraInfo="() => toggleExtraInfo(timetableEntry.id)"
|
||||||
:showExtraInfo="extraInfoIndexes.includes(timetableEntry.id)"
|
:showExtraInfo="extraInfoIndexes.includes(timetableEntry.id)"
|
||||||
/>
|
/>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
@@ -90,6 +90,14 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
timetableHistory: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.extraInfoIndexes.length = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleExtraInfo(id: number) {
|
toggleExtraInfo(id: number) {
|
||||||
const existingIdx = this.extraInfoIndexes.indexOf(id);
|
const existingIdx = this.extraInfoIndexes.indexOf(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user