Hide settings pane on outside click, render above places pane

This commit is contained in:
Râu Cao 2026-01-24 21:06:50 +07:00
parent 911e6ddf38
commit 1a96f95c82
Signed by: raucao
GPG Key ID: 37036C356E56CC51
2 changed files with 16 additions and 3 deletions

View File

@ -197,6 +197,10 @@ body {
flex-direction: column;
}
.settings-pane.sidebar {
z-index: 3200; /* Higher than Places Sidebar (3100) */
}
/* Settings Pane Mobile Overrides */
@media (width <= 768px) {
.settings-pane.sidebar {

View File

@ -8,7 +8,7 @@ import { service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { eq } from 'ember-truth-helpers';
import { and } from 'ember-truth-helpers';
import { and, or } from 'ember-truth-helpers';
import { on } from '@ember/modifier';
export default class ApplicationComponent extends Component {
@ -74,6 +74,15 @@ export default class ApplicationComponent extends Component {
}
}
@action
handleOutsideClick() {
if (this.isSettingsOpen) {
this.closeSettings();
} else {
this.closeSidebar();
}
}
@action
closeSidebar() {
this.nearbyPlaces = null;
@ -105,8 +114,8 @@ export default class ApplicationComponent extends Component {
<Map
@onPlacesFound={{this.showPlaces}}
@isSidebarOpen={{this.isSidebarOpen}}
@onOutsideClick={{this.closeSidebar}}
@isSidebarOpen={{or this.isSidebarOpen this.isSettingsOpen}}
@onOutsideClick={{this.handleOutsideClick}}
/>
{{#if (and (eq this.router.currentRouteName "index") this.nearbyPlaces)}}