Skip to content

Commit c087597

Browse files
authored
Merge pull request #5209 from HSLdevcom/DT-6590
DT-6590 Prevent locationPopup during navimode
2 parents d021588 + 981ea14 commit c087597

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

app/component/itinerary/ItineraryPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,7 @@ export default function ItineraryPage(props, context) {
11031103
objectsToHide={objectsToHide}
11041104
itinerary={explicitItinerary}
11051105
showBackButton={!naviMode}
1106+
isLocationPopupEnabled={!naviMode}
11061107
/>
11071108
);
11081109
}

app/component/map/ItineraryPageMap.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function ItineraryPageMap(
3232
showDurationBubble,
3333
itinerary,
3434
showBackButton,
35+
isLocationPopupEnabled,
3536
...rest
3637
},
3738
{ match, router, executeAction, config },
@@ -99,13 +100,18 @@ function ItineraryPageMap(
99100
leafletObjs.push(<LocationMarker key={`via_${i}`} position={via} />);
100101
});
101102

102-
// max 5 viapoints
103-
const locationPopup =
104-
config.viaPointsEnabled && viaPoints.length < 5
105-
? 'all'
106-
: 'origindestination';
107-
const onSelectLocation = (item, id) =>
108-
onLocationPopup(item, id, router, match, executeAction);
103+
let locationPopup = 'none';
104+
let onSelectLocation;
105+
106+
if (isLocationPopupEnabled) {
107+
// max 5 viapoints
108+
locationPopup =
109+
config.viaPointsEnabled && viaPoints.length < 5
110+
? 'all'
111+
: 'origindestination';
112+
onSelectLocation = (item, id) =>
113+
onLocationPopup(item, id, router, match, executeAction);
114+
}
109115

110116
return (
111117
<MapWithTracking
@@ -149,6 +155,7 @@ ItineraryPageMap.propTypes = {
149155
showDurationBubble: PropTypes.bool,
150156
itinerary: itineraryShape,
151157
showBackButton: PropTypes.bool,
158+
isLocationPopupEnabled: PropTypes.bool,
152159
};
153160

154161
ItineraryPageMap.defaultProps = {
@@ -158,6 +165,7 @@ ItineraryPageMap.defaultProps = {
158165
showDurationBubble: false,
159166
itinerary: undefined,
160167
showBackButton: true,
168+
isLocationPopupEnabled: false,
161169
};
162170

163171
ItineraryPageMap.contextTypes = {

0 commit comments

Comments
 (0)