fixed remove

This commit is contained in:
Joel McKinnon 2020-01-22 08:17:03 -08:00
parent 621c1dc11e
commit 2d8f61172d
2 changed files with 6 additions and 2 deletions

View File

@ -37,6 +37,7 @@
<ConditionEdit :condition-identifier="conditionIdentifier"
:is-current="currentConditionIdentifier"
@update-current-condition="updateCurrentCondition"
@remove-condition="removeCondition"
/>
</div>
<div v-else>
@ -136,8 +137,10 @@ export default {
this.conditions[index] = updatedCondition;
},
removeCondition(identifier) {
let index = _.findIndex(this.conditionCollection, (condition) => this.openmct.objects.makeKeyString(identifier) === condition.identifier.key);
this.conditionCollection.splice(index, 1);
let index = _.findIndex(this.conditionCollection, (condition) => {
identifier.key === condition.key
});
this.conditionCollection.splice(index + 1, 1);
},
reorder(reorderPlan) {
let oldConditions = this.conditionCollection.slice();

View File

@ -177,6 +177,7 @@ export default {
},
methods: {
removeCondition(ev) {
this.$emit('remove-condition', this.conditionIdentifier);
// const conditionDiv = ev.target.closest('.conditionArea');
// const conditionCollectionDiv = conditionDiv.closest('.condition-collection');
// const index = Array.from(conditionCollectionDiv.children).indexOf(conditionDiv);