From 355df789aaca854d4bf668779af2ab6825dfd3d8 Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 22 Aug 2022 14:15:23 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20b=C5=82=C4=99du=20z=20wyborem=20=C5=82adu?= =?UTF-8?q?nk=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/InputsSection.vue | 10 +++++++--- src/components/TrainImageSection.vue | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/InputsSection.vue b/src/components/InputsSection.vue index d47053c..a0a065f 100644 --- a/src/components/InputsSection.vue +++ b/src/components/InputsSection.vue @@ -70,8 +70,8 @@ data-select="cargo" data-ignore-outside="1" v-model="store.chosenCargo" - @focus="onVehicleSelect('car')" - @change="onVehicleSelect('car')" + @focus="onVehicleSelect('cargo')" + @change="onVehicleSelect('cargo')" @keydown.enter.prevent="addOrSwitchVehicle" @keydown.backspace="removeVehicle" > @@ -199,11 +199,14 @@ export default defineComponent({ this.store.swapVehicles = true; }, - onVehicleSelect(type: 'loco' | 'car') { + onVehicleSelect(type: 'loco' | 'car' | 'cargo') { this.$nextTick(() => { if (!this.store.chosenLoco && !this.store.chosenCar) return; this.store.chosenVehicle = type == 'loco' ? this.store.chosenLoco : this.store.chosenCar; + + this.store.chosenCargo = + this.store.chosenCar?.cargoList.find((cargo) => cargo.id == this.store.chosenCargo?.id) || null; }); }, @@ -362,3 +365,4 @@ export default defineComponent({ } } + diff --git a/src/components/TrainImageSection.vue b/src/components/TrainImageSection.vue index 4f28ec3..da9b19f 100644 --- a/src/components/TrainImageSection.vue +++ b/src/components/TrainImageSection.vue @@ -116,7 +116,7 @@ export default defineComponent({ grid-column: 1; margin-top: 2em; - height: 290px; + height: 20em; } .train-image {