Skip to content

Commit

Permalink
feat: show new info badge instead of opening sidebar automatically wh…
Browse files Browse the repository at this point in the history
…en in low resolution

show the new info badge on the top-left corner menu instead of opening the sidebar automatically
when a place is selected or a route is calculated
  • Loading branch information
amoncaldas committed Aug 2, 2021
1 parent 0186124 commit ff0049e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/fragments/forms/map-form/components/map-form-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export default {
* @param open boolean|event - sidebar pinned desired status - if it is a boolean, use it.
*/
setSidebarIsOpen(open) {
open = typeof open === 'boolean' ? open : this.$store.getters.leftSideBarPinned || (this.$mdAndUpResolution && !this.$store.getters.embed)
if (typeof open !== 'boolean') {
open = this.$store.getters.leftSideBarPinned || (this.$mdAndUpResolution && !this.$store.getters.embed)
}
this.$store.commit('setLeftSideBarIsOpen', open)
},
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,9 @@ export default {
if (this.$store.getters.mode !== constants.modes.search) {
const isRoundTrip = this.$store.getters.mode === constants.modes.roundTrip

// Just enter here if we are dealing with directions round trip
// If there are more then 1 place, then it is directions
// if there is only one place and it is round trip, then we are also
// Just enter here if we are dealing with directions round trip.
// If there are more then 1 place, then it is directions mode.
// If there is only one place and it is round trip, then we are also
// dealing with directions, but an special directions (a round trip directions!)
let context = this
if (isRoundTrip && this.getFilledPlaces().length === 1) {
Expand All @@ -563,12 +563,13 @@ export default {

/**
* Prepare the view and the data for the directions/routing mode
* and data according the amount of filled places
* according the amount of filled places
* @emits mapViewDataChanged
*/
prepareDirectionsViewAndData () {
this.setViewMode(constants.modes.directions)
this.setSidebarIsOpen(true)
this.setSidebarIsOpen()
this.eventBus.$emit('newInfoAvailable')

// Only calculate a route if there are more then one place defined
if (this.getFilledPlaces().length > 1) {
Expand Down

0 comments on commit ff0049e

Please sign in to comment.