Fix code style and add missing semicolons

This commit is contained in:
dhrubomoy
2017-06-21 15:29:28 -04:00
parent 17a067752f
commit f20c8b7d99
3 changed files with 37 additions and 37 deletions

View File

@ -43,12 +43,18 @@ define(
// If "options" include name, value pair
$scope.optionNames = $scope.options.map(function (opt) {
return opt.name;
})
});
} else {
// If options is only an array of string.
$scope.optionNames = $scope.options;
}
function fillInputWithIndexedOption() {
if ($scope.filteredOptions[$scope.optionIndex]) {
$scope.ngModel[$scope.field] = $scope.filteredOptions[$scope.optionIndex].name;
}
}
function decrementOptionIndex() {
if ($scope.optionIndex === 0) {
$scope.optionIndex = $scope.filteredOptions.length;
@ -70,12 +76,6 @@ define(
$scope.ngModel[$scope.field] = string;
}
function fillInputWithIndexedOption() {
if($scope.filteredOptions[$scope.optionIndex]) {
$scope.ngModel[$scope.field] = $scope.filteredOptions[$scope.optionIndex].name;
}
}
function showOptions(string) {
$scope.hideOptions = false;
$scope.filterOptions(string);
@ -99,7 +99,7 @@ define(
}
}
}
}
};
$scope.filterOptions = function (string) {
$scope.hideOptions = false;
@ -109,27 +109,27 @@ define(
return {
optionId: index,
name: option
}
};
});
}
};
$scope.inputClicked = function () {
autocompleteInputElement.select();
showOptions(autocompleteInputElement.value);
}
};
$scope.arrowClicked = function () {
autocompleteInputElement.select();
showOptions('');
}
};
$scope.fillInput = function (string) {
fillInputWithString(string);
}
};
$scope.optionMouseover = function (optionId) {
$scope.optionIndex = optionId;
}
};
}
return AutocompleteController;