Hide settings pane on outside click, render above places pane
This commit is contained in:
parent
911e6ddf38
commit
1a96f95c82
@ -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 {
|
||||
|
||||
@ -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)}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user