Skip to content

Commit

Permalink
fix(alternative-routes): mismatched open route details
Browse files Browse the repository at this point in the history
when selecting an alternative route via map or the
button in the route details, the active route would
change but the details would not be expanded.

The panel that should be expanded is now set from the,
activeRouteIndex in the store.

- avoid collapsing again for button in the route details
  • Loading branch information
TheGreatRefrigerator committed Apr 9, 2024
1 parent 0ff7847 commit dbbaa51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<print :map-view-data="mapViewData"></print>
<h3>{{$t('routeDetails.routeDetails')}}</h3>
</div>
<v-expansion-panel slot="content" class="no-shadow" v-if="hasRoutes" :value="startedPanelExtended">
<v-expansion-panel slot="content" class="no-shadow" v-if="hasRoutes" :value="panelExtended">
<v-expansion-panel-content style="background: transparent;" class="routes-header" :key="routeIndex" v-for="(route, routeIndex) in parsedRoutes">
<div slot="header">
<h4 >{{$t('routeDetails.route')}} {{routeIndex + 1}} ({{route.summary.distance}})
<v-btn icon @click="changeActiveRouteIndex(routeIndex)" v-if="parsedRoutes.length > 1" :title="routeIndex === $store.getters.activeRouteIndex? $t('routeDetails.selectedRoute') : $t('routeDetails.selectRoute')">
<v-btn icon @click.stop="changeActiveRouteIndex(routeIndex)" v-if="parsedRoutes.length > 1" :title="routeIndex === $store.getters.activeRouteIndex? $t('routeDetails.selectedRoute') : $t('routeDetails.selectRoute')">
<v-icon :color="routeIndex === $store.getters.activeRouteIndex? 'primary' : 'dark' " >done</v-icon>
</v-btn>
</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default {
shareUrl () {
return location.href
},
startedPanelExtended () {
return this.localMapViewData.routes.length > 0 ? 0 : null
panelExtended () {
return this.localMapViewData.routes.length > 0 ? this.$store.getters.activeRouteIndex : null
},
/**
* Builds and return the routes
Expand Down

0 comments on commit dbbaa51

Please sign in to comment.