eslint rules

This commit is contained in:
Carlos Jimenez 2018-10-31 13:44:43 +01:00
parent 5541e46d50
commit 7398d20132
1 changed files with 5 additions and 6 deletions

View File

@ -168,12 +168,12 @@ export default class Autocomplete extends Input {
} }
onSelectionRequest(data) { onSelectionRequest(data) {
if (data && data.length > 0) if (data && data.length > 0)
if (this.multiple) if (this.multiple)
this.selection = data; this.selection = data;
else else
this.selection = data[0]; this.selection = data[0];
else else
this.selection = null; this.selection = null;
} }
@ -181,7 +181,7 @@ export default class Autocomplete extends Input {
let display = ''; let display = '';
let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem'); let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem');
if (this._selection && this.showField) if (this._selection && this.showField)
if (this.multiple && Array.isArray(this._selection)) { if (this.multiple && Array.isArray(this._selection)) {
for (let item of this._selection) { for (let item of this._selection) {
if (display.length > 0) display += ', '; if (display.length > 0) display += ', ';
@ -194,13 +194,12 @@ export default class Autocomplete extends Input {
display = this.$interpolate(template)(this._selection); display = this.$interpolate(template)(this._selection);
} }
} }
this.input.value = display; this.input.value = display;
if (this.translateFields) if (this.translateFields)
if (this.translateFields.indexOf(this.showField) > -1) if (this.translateFields.indexOf(this.showField) > -1)
this.input.value = this.$translate.instant(display); this.input.value = this.$translate.instant(display);
this.mdlUpdate(); this.mdlUpdate();
} }