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