From eba18b0235e22abddd566dcddbac40171f8bc9fd Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 26 Jun 2020 08:49:35 +0200 Subject: [PATCH] Close menu's on map click --- projects/common-map/src/fm-map/components/map/map.component.ts | 2 +- projects/common-map/src/fm-map/reducers/map.reducer.ts | 3 +++ .../src/fm/components/user-menu/user-menu.component.scss | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/common-map/src/fm-map/components/map/map.component.ts b/projects/common-map/src/fm-map/components/map/map.component.ts index 23c0c8f..f190621 100644 --- a/projects/common-map/src/fm-map/components/map/map.component.ts +++ b/projects/common-map/src/fm-map/components/map/map.component.ts @@ -356,7 +356,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { handleOnMouseDown(event: MouseEvent) { event.stopPropagation(); this.zone.run(() =>{ - this.store.dispatch(new mapActions.CollapseSearch()); + this.store.dispatch(new commonActions.CloseAll()); }); } diff --git a/projects/common-map/src/fm-map/reducers/map.reducer.ts b/projects/common-map/src/fm-map/reducers/map.reducer.ts index ca249c2..32f4009 100644 --- a/projects/common-map/src/fm-map/reducers/map.reducer.ts +++ b/projects/common-map/src/fm-map/reducers/map.reducer.ts @@ -307,6 +307,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo case mapActions.COLLAPSESEARCH: { return tassign(state, { searchCollapsed: state.panelVisible ? false: true}); } + case commonActions.CLOSEALL: { + return tassign(state, { searchCollapsed: state.panelVisible ? false: true,showLayerSwitcher:false}); + } case mapActions.SETEXTENT: { let a = action as mapActions.SetExtent; return tassign(state, { extent: a.extent }); diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.scss b/projects/common/src/fm/components/user-menu/user-menu.component.scss index 4538297..a3fe179 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.scss +++ b/projects/common/src/fm/components/user-menu/user-menu.component.scss @@ -16,7 +16,7 @@ div.menu-button > span { .menu { max-height: 100vh; - transition: max-height 0.2s; + //transition: max-height 0.2s; overflow: hidden; box-shadow: 0 0 20px rgba(0,0,0,.3); position: absolute;