From 42bfbadd306696445ee9d298373e075847f5f963 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Mon, 10 Sep 2018 09:05:47 -0300 Subject: [PATCH] Filter modal adjustments on loop that sends values to tags. --- .../components/other/checkbox-filter-modal.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/admin/components/other/checkbox-filter-modal.vue b/src/admin/components/other/checkbox-filter-modal.vue index 1009ccc25..3770f6b34 100644 --- a/src/admin/components/other/checkbox-filter-modal.vue +++ b/src/admin/components/other/checkbox-filter-modal.vue @@ -470,17 +470,26 @@ collection_id: this.collection_id ? this.collection_id : this.filter.collection_id, value: this.selected, }); + // if(!isNaN(this.selected[0])){ + // for (let option of this.options) { + // let valueIndex = this.selected.findIndex(item => item == option.value); + // if (valueIndex >= 0) { + // onlyLabels.push(this.options[valueIndex].label); + // console.log(this.selected[valueIndex]); + // console.log(this.options[valueIndex].value); + // } + // } + // } if(!isNaN(this.selected[0])){ - for (let option of this.options) { - let valueIndex = this.selected.findIndex(item => item == option.value); + for (let aSelected of this.selected) { + let valueIndex = this.options.findIndex(option => option.value == aSelected); if (valueIndex >= 0) { onlyLabels.push(this.options[valueIndex].label); } } } - onlyLabels = onlyLabels.length ? onlyLabels : this.selected; this.$eventBusSearch.$emit( 'sendValuesToTags', {