Skip to content

Commit

Permalink
Merge 441b424 into 995c851
Browse files Browse the repository at this point in the history
  • Loading branch information
dickschoeller committed Aug 12, 2018
2 parents 995c851 + 441b424 commit ab065b6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ export class AttributeDialogHelper {
}

private getByType(typeInput: string) {
return this.getBy(this.parent.attribute.attributes, typeInput, (attr) => attr.type.toLowerCase());
return this.getBy(this.parent.attribute.attributes, typeInput, (attr) => attr.type.toLowerCase(), (attr) => attr.string);
}

private getByString(stringInput: string) {
return this.getBy(this.parent.attribute.attributes, stringInput, (attr) => attr.string);
return this.getBy(this.parent.attribute.attributes, stringInput, (attr) => attr.string, (attr) => attr.tail);
}

private getBy(attributes: Array<ApiAttribute>, input: string, getField) {
private getBy(attributes: Array<ApiAttribute>, input: string, getField, getValue) {
for (const attr of attributes) {
if (getField(attr) === input) {
return attr.tail;
return getValue(attr);
}
}
}
Expand Down

0 comments on commit ab065b6

Please sign in to comment.