diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js index 03220630f..19194e318 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js @@ -44,7 +44,9 @@ function loadDynamicPicker(element) { ':suggested="notPickedSuggested" ' + ':label="label" ' + '@addNewEntity="addNewEntity" ' + - '@removeEntity="removeEntity">', + '@removeEntity="removeEntity" ' + + '@addNewEntityProcessEnded="addNewEntityProcessEnded"' + + '>', components: { PickEntity, }, @@ -97,10 +99,11 @@ function loadDynamicPicker(element) { } } } - - if (this.submit_on_adding_new_entity) { - input.form.submit(); - } + }, + addNewEntityProcessEnded() { + if (this.submit_on_adding_new_entity) { + input.form.submit(); + } }, removeEntity({entity}) { if (-1 === this.suggested.findIndex(e => e.type === entity.type && e.id === entity.id)) { diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue index 75abc4fdd..e2ba91f8f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue @@ -62,7 +62,7 @@ export default { required: false, } }, - emits: ['addNewEntity', 'removeEntity'], + emits: ['addNewEntity', 'removeEntity', 'addNewEntityProcessEnded'], components: { AddPersons, }, @@ -121,6 +121,7 @@ export default { ); this.$refs.addPersons.resetSearch(); // to cast child method modal.showModal = false; + this.$emit('addNewEntityProcessEnded'); }, removeEntity(entity) { if (!this.$props.removableIfSet) {