fixed recording entity when switching or closing entity

This commit is contained in:
Bachir Soussi Chiadmi 2025-06-03 13:01:02 +02:00
parent cc943c5776
commit a9e6fe2567

View File

@ -87,7 +87,8 @@ export default {
'detailsZoomValue', 'detailsZoomValue',
'reloadConcernements', 'reloadConcernements',
'reloadConcernementEntites', 'reloadConcernementEntites',
'concernements_loading_nb']), 'concernements_loading_nb',
'concernement_is_updating_nid']),
...mapState(CommonStore,['hover_elmt', ...mapState(CommonStore,['hover_elmt',
'map_item_ray', 'map_item_ray',
'cartouch_width', 'cartouch_width',
@ -2630,6 +2631,12 @@ export default {
case "superposition": case "superposition":
case "action": case "action":
// we have clicked on an entite // we have clicked on an entite
// unfocus any active element to trigger recording if needed
document.activeElement.blur();
// setInterval to let time for editable fields to focus out and record changes
let interval = setInterval(() => {
if (!this.concernement_is_updating_nid) {
clearInterval(interval);
this.$router.push({ this.$router.push({
name: 'concernement', name: 'concernement',
params: {cid: this.cid, eid: result.item.item_id}, params: {cid: this.cid, eid: result.item.item_id},
@ -2639,6 +2646,8 @@ export default {
}, },
hash: `#${this.map_mode}`, hash: `#${this.map_mode}`,
}); });
}
}, 1)
break; break;
case "proximite": case "proximite":
switch (result.item.item_type) { switch (result.item.item_type) {
@ -2669,11 +2678,20 @@ export default {
} else { } else {
// otherwise we close the entite and come back to the concernement // otherwise we close the entite and come back to the concernement
// unfocus any active element to trigger recording if needed
document.activeElement.blur();
// setInterval to let time for editable fields to focus out and record changes
let interval = setInterval(() => {
if (!this.concernement_is_updating_nid) {
clearInterval(interval);
this.$router.push({ this.$router.push({
name: 'concernement', name: 'concernement',
hash: `#${this.map_mode}`, hash: `#${this.map_mode}`,
params: {id: this.cid, mapitemid: this.id} params: {id: this.cid, mapitemid: this.id}
}); });
}
}, 1)
// reset the mousehover // reset the mousehover
this.resetHoverElmt(); this.resetHoverElmt();