map menu 'action' is working

This commit is contained in:
2023-04-26 12:21:28 +02:00
parent 82731a4884
commit 72d79f8d84
4 changed files with 163 additions and 101 deletions

View File

@@ -183,8 +183,12 @@ export default {
if (query.length) {
// open/close all concernements
this.openCloseConcernements(query[0].id)
// push route
this.$router.push({name: 'concernement', params: {id: query[0].id}});
// push route (keep the hash for map_mode)
this.$router.push({
name: 'concernement',
hash: `#${this.map_mode}`,
params: {id: query[0].id}
});
}
}
@@ -200,16 +204,27 @@ export default {
});
if (clickedEntityBodies.length) {
// we have clicked on an entite
this.$router.push({name: 'concernement', params: {id: this.opened.id, eid: clickedEntityBodies[0].id}});
this.$router.push({
name: 'concernement',
hash: `#${this.map_mode}`,
params: {id: this.opened.id, eid: clickedEntityBodies[0].id}
});
} else {
// otherwise we close the entite and come back to the concernement
this.$router.push({name: 'concernement', params: {id: this.opened.id}});
this.$router.push({
name: 'concernement',
hash: `#${this.map_mode}`,
params: {id: this.opened.id}
});
}
} else {
// if no concernement opened retrun to home (closing concernement contents opened)
// and reset the opened state in concernement store
this.resetConcernementOpened();
this.$router.push({name: 'home'});
this.$router.push({
name: 'home',
hash: `#${this.map_mode}`
});
}
}
}