diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 116ed86c1..c3522863c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -160,7 +160,10 @@ export default { }, badgeType() { return 'entity-' + this.type + ' badge-' + this.type; - } + }, + getReturnPath() { + return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`; + }, }, watch: { canCloseModal: { @@ -217,9 +220,9 @@ export default { buildLocation(id, type) { if (type === 'person') { // TODO i18n - return `/fr/person/${id}/general`; + return encodeURI(`/fr/person/${id}/general${this.getReturnPath}`); } else if (type === 'thirdparty') { - return `/fr/3party/3party/${id}/view`; + return encodeURI(`/fr/3party/3party/${id}/view${this.getReturnPath}`); } } }