|
@@ -59,6 +59,7 @@ export default {
|
|
|
...mapState(ConcernementsStore,['map_mode',
|
|
|
'concernementsByID',
|
|
|
'allSuperpositions_byid',
|
|
|
+ 'allMapItems_byid',
|
|
|
'opened_concernement',
|
|
|
'opened_entite_id']),
|
|
|
...mapState(CommonStore,['hover_elmt',
|
|
@@ -68,7 +69,7 @@ export default {
|
|
|
'paper_symbol_definitions'])
|
|
|
},
|
|
|
created () {
|
|
|
- console.log('ConcernementMapItem', this.mapitem);
|
|
|
+ console.log('ConcernementMapItem created', this.mapitem);
|
|
|
// this.id = this.superposition_id ? `${this.cid}___${this.superposition_id}` : this.cid;
|
|
|
this.id = this.mapitem.id;
|
|
|
this.concernement = this.mapitem.concernement;
|
|
@@ -1722,15 +1723,33 @@ export default {
|
|
|
if (this.opened_concernement) {
|
|
|
// console.log("try to push aside", this.opened_concernement.opened_mapitem_id, this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]);
|
|
|
// console.log(this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id].indexOf(this.id));
|
|
|
- if (
|
|
|
- // this.opened_concernement.id !== this.cid &&
|
|
|
- this.opened_concernement.opened_mapitem_id !== this.id
|
|
|
- // && (!this.opened_concernement.all_superposed_concernements_id || this.opened_concernement.all_superposed_concernements_id.indexOf(this.id) < 0)
|
|
|
- && (!this.opened_concernement.superposed_mapitem_id_by_mapitem_id
|
|
|
- || !this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id] // when we are not in superposition mode
|
|
|
- || this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id].indexOf(this.id) < 0) // this mapitem is not superposed to the opened mapitem
|
|
|
- ) {
|
|
|
- this.pushAside()
|
|
|
+ if (this.opened_concernement.opened_mapitem_id !== this.id) {
|
|
|
+ // push all aside mapitems not superposed the the opened mapitem
|
|
|
+ let pushaside = true;
|
|
|
+
|
|
|
+ // BUT NOT push aside mapitems superposed to superposed mapitems
|
|
|
+ // opened_mapitem <-- superposed_mapitems <-- superposed_mapitem
|
|
|
+ if (this.opened_concernement.superposed_mapitem_id_by_mapitem_id
|
|
|
+ && this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id])
|
|
|
+ { // if opened mapitem has superposed mapitems
|
|
|
+ let superposed_ids = this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]
|
|
|
+ if (superposed_ids.indexOf(this.id) >= 0) { //this mapitem is directly superposed to the opened mapitem
|
|
|
+ pushaside = false;
|
|
|
+ } else { // else we look for second stage of the rockette ... superposed to superposed to opened
|
|
|
+ superposed_ids.forEach(mapitem_id => { // for each superposed map_item, check if this mapitem is in their superposed
|
|
|
+ let mapitem = this.allMapItems_byid[mapitem_id]; // get the superposed (stage 1) mapitem
|
|
|
+ mapitem.superposition_ids.forEach(sup_id => { // for each superposed (stage 2) of the superposed (stage 1)
|
|
|
+ if (this.mapitem.superposition_ids.indexOf(sup_id) >= 0) {
|
|
|
+ pushaside = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pushaside) {
|
|
|
+ this.pushAside()
|
|
|
+ }
|
|
|
}
|
|
|
} else if (!this.is_hover){
|
|
|
if (this.map_mode === 'proximite'
|