Skip to content

Commit

Permalink
fix(map-form-mixin): sidebar open state consider the app and embed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Aug 4, 2021
1 parent 0f642be commit 1550460
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/fragments/forms/map-form/components/map-form-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,12 @@ export default {
}
},
/**
* Set the visibility of the sidebar depending on the screen breakpoint
* and the auto focus on map option
* @param open boolean|event - sidebar pinned desired status - if it is a boolean, use it.
* Set the visibility of the sidebar depending on the screen breakpoint, embed mode and app mode
* @param open boolean|null
*/
setSidebarIsOpen(open) {
if (typeof open !== 'boolean') {
open = this.$store.getters.leftSideBarPinned || (this.$mdAndUpResolution && !this.$store.getters.embed)
if (typeof open !== 'boolean' && !this.$store.getters.embed) {
open = this.$store.getters.leftSideBarPinned || this.$mdAndUpResolution || (this.$store.getters.mode === constants.modes.directions && Place.getFilledPlaces(this.places).length === 1)
}
this.$store.commit('setLeftSideBarIsOpen', open)
},
Expand Down

0 comments on commit 1550460

Please sign in to comment.