diff --git a/js/components/clin_fields.js b/js/components/clin_fields.js index b51c8b62..327bedf0 100644 --- a/js/components/clin_fields.js +++ b/js/components/clin_fields.js @@ -1,4 +1,4 @@ -import { emitFieldChange, emitEvent } from '../lib/emitters' +import { emitFieldChange } from '../lib/emitters' import optionsinput from './options_input' import textinput from './text_input' import clindollaramount from './clin_dollar_amount' @@ -61,23 +61,7 @@ export default { this.validateFunding() }, - created: function() { - emitEvent('clin-change', this, { - id: this._uid, - obligatedAmount: this.initialObligated, - totalAmount: this.initialTotal, - }) - }, - methods: { - clinChangeEvent: function() { - emitEvent('clin-change', this, { - id: this._uid, - obligatedAmount: this.initialObligated, - totalAmount: this.initialTotal, - }) - }, - checkFundingValid: function() { return this.obligatedAmount <= this.totalAmount }, @@ -103,7 +87,7 @@ export default { removeClin: function() { this.showClin = false - emitEvent('remove-clin', this, { + this.$parent.$emit('remove-clin', this, { clinIndex: this.clinIndex, }) this.removed = true diff --git a/js/components/forms/to_form.js b/js/components/forms/to_form.js index a615013b..832a625f 100644 --- a/js/components/forms/to_form.js +++ b/js/components/forms/to_form.js @@ -36,7 +36,7 @@ export default { }, mounted: function() { - this.$root.$on('remove-clin', this.handleRemoveClin) + this.$on('remove-clin', this.handleRemoveClin) }, methods: { diff --git a/js/lib/emitters.js b/js/lib/emitters.js index dbc5b37f..70314863 100644 --- a/js/lib/emitters.js +++ b/js/lib/emitters.js @@ -1,10 +1,3 @@ -export const emitEvent = (event_type, el, data) => { - el.$root.$emit(event_type, { - ...data, - parent_uid: el.$parent && el.$parent._uid, - }) -} - export const emitFieldChange = (el, data = null) => { el.$parent.$emit('field-change', data) }