Filter modal adjustments on loop that sends values to tags.

This commit is contained in:
Mateus Machado Luna 2018-09-10 09:05:47 -03:00
parent 7f44540240
commit 42bfbadd30
1 changed files with 12 additions and 3 deletions

View File

@ -470,17 +470,26 @@
collection_id: this.collection_id ? this.collection_id : this.filter.collection_id, collection_id: this.collection_id ? this.collection_id : this.filter.collection_id,
value: this.selected, 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])){ if(!isNaN(this.selected[0])){
for (let option of this.options) { for (let aSelected of this.selected) {
let valueIndex = this.selected.findIndex(item => item == option.value); let valueIndex = this.options.findIndex(option => option.value == aSelected);
if (valueIndex >= 0) { if (valueIndex >= 0) {
onlyLabels.push(this.options[valueIndex].label); onlyLabels.push(this.options[valueIndex].label);
} }
} }
} }
onlyLabels = onlyLabels.length ? onlyLabels : this.selected; onlyLabels = onlyLabels.length ? onlyLabels : this.selected;
this.$eventBusSearch.$emit( 'sendValuesToTags', { this.$eventBusSearch.$emit( 'sendValuesToTags', {