Keep search results, only hide sidebar when closed

This commit is contained in:
2026-04-27 14:27:25 +01:00
parent a0b4a4b3f3
commit d2eb888dcf
9 changed files with 69 additions and 46 deletions

View File

@@ -11,6 +11,7 @@ export default class SearchTemplate extends Component {
selectPlace(place) {
if (place) {
this.mapUi.returnToSearch = true;
this.mapUi.showSidebar();
// We don't need to manually set currentSearch here because
// it was already set in the route's setupController
this.router.transitionTo('place', place);
@@ -19,14 +20,16 @@ export default class SearchTemplate extends Component {
@action
close() {
this.router.transitionTo('index');
this.mapUi.hideSidebar();
}
<template>
<PlacesSidebar
@places={{@model}}
@onSelect={{this.selectPlace}}
@onClose={{this.close}}
/>
{{#if this.mapUi.isSidebarVisible}}
<PlacesSidebar
@places={{@model}}
@onSelect={{this.selectPlace}}
@onClose={{this.close}}
/>
{{/if}}
</template>
}