Hide settings pane on outside click, render above places pane
This commit is contained in:
@@ -197,6 +197,10 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-pane.sidebar {
|
||||||
|
z-index: 3200; /* Higher than Places Sidebar (3100) */
|
||||||
|
}
|
||||||
|
|
||||||
/* Settings Pane Mobile Overrides */
|
/* Settings Pane Mobile Overrides */
|
||||||
@media (width <= 768px) {
|
@media (width <= 768px) {
|
||||||
.settings-pane.sidebar {
|
.settings-pane.sidebar {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { service } from '@ember/service';
|
|||||||
import { tracked } from '@glimmer/tracking';
|
import { tracked } from '@glimmer/tracking';
|
||||||
import { action } from '@ember/object';
|
import { action } from '@ember/object';
|
||||||
import { eq } from 'ember-truth-helpers';
|
import { eq } from 'ember-truth-helpers';
|
||||||
import { and } from 'ember-truth-helpers';
|
import { and, or } from 'ember-truth-helpers';
|
||||||
import { on } from '@ember/modifier';
|
import { on } from '@ember/modifier';
|
||||||
|
|
||||||
export default class ApplicationComponent extends Component {
|
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
|
@action
|
||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
this.nearbyPlaces = null;
|
this.nearbyPlaces = null;
|
||||||
@@ -105,8 +114,8 @@ export default class ApplicationComponent extends Component {
|
|||||||
|
|
||||||
<Map
|
<Map
|
||||||
@onPlacesFound={{this.showPlaces}}
|
@onPlacesFound={{this.showPlaces}}
|
||||||
@isSidebarOpen={{this.isSidebarOpen}}
|
@isSidebarOpen={{or this.isSidebarOpen this.isSettingsOpen}}
|
||||||
@onOutsideClick={{this.closeSidebar}}
|
@onOutsideClick={{this.handleOutsideClick}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{#if (and (eq this.router.currentRouteName "index") this.nearbyPlaces)}}
|
{{#if (and (eq this.router.currentRouteName "index") this.nearbyPlaces)}}
|
||||||
|
|||||||
Reference in New Issue
Block a user