Remove other events emitted from root

This commit is contained in:
leigh-mil 2019-11-13 16:52:02 -05:00
parent 04b9250ea1
commit a6a908ae55
3 changed files with 3 additions and 26 deletions

View File

@ -1,4 +1,4 @@
import { emitFieldChange, emitEvent } from '../lib/emitters' import { emitFieldChange } from '../lib/emitters'
import optionsinput from './options_input' import optionsinput from './options_input'
import textinput from './text_input' import textinput from './text_input'
import clindollaramount from './clin_dollar_amount' import clindollaramount from './clin_dollar_amount'
@ -61,23 +61,7 @@ export default {
this.validateFunding() this.validateFunding()
}, },
created: function() {
emitEvent('clin-change', this, {
id: this._uid,
obligatedAmount: this.initialObligated,
totalAmount: this.initialTotal,
})
},
methods: { methods: {
clinChangeEvent: function() {
emitEvent('clin-change', this, {
id: this._uid,
obligatedAmount: this.initialObligated,
totalAmount: this.initialTotal,
})
},
checkFundingValid: function() { checkFundingValid: function() {
return this.obligatedAmount <= this.totalAmount return this.obligatedAmount <= this.totalAmount
}, },
@ -103,7 +87,7 @@ export default {
removeClin: function() { removeClin: function() {
this.showClin = false this.showClin = false
emitEvent('remove-clin', this, { this.$parent.$emit('remove-clin', this, {
clinIndex: this.clinIndex, clinIndex: this.clinIndex,
}) })
this.removed = true this.removed = true

View File

@ -36,7 +36,7 @@ export default {
}, },
mounted: function() { mounted: function() {
this.$root.$on('remove-clin', this.handleRemoveClin) this.$on('remove-clin', this.handleRemoveClin)
}, },
methods: { methods: {

View File

@ -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) => { export const emitFieldChange = (el, data = null) => {
el.$parent.$emit('field-change', data) el.$parent.$emit('field-change', data)
} }