mirror of
https://github.com/nasa/openmct.git
synced 2025-01-03 03:46:42 +00:00
[Search] Not case sensitive
Search is no longer case sensitive.
This commit is contained in:
parent
b5756d2b99
commit
6d1cb85a07
@ -88,13 +88,20 @@ define(function () {
|
||||
console.log('search called, with term ', term);
|
||||
var searchResults = [],
|
||||
itemsLength,
|
||||
itemName,
|
||||
i;
|
||||
// Make not case sensitive
|
||||
if (term) {
|
||||
term = term.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
// refresh items list
|
||||
return listify().then( function () {
|
||||
itemsLength = $scope.items.length; // Slight time optimization
|
||||
for (i = 0; i < itemsLength; i += 1) {
|
||||
console.log('items[', i, '].getModel', $scope.items[i].getModel());
|
||||
if ($scope.items[i].getModel().name.includes(term)) {
|
||||
itemName = $scope.items[i].getModel().name;
|
||||
console.log('items[', i, '] name', itemName);
|
||||
if (itemName.toLocaleLowerCase().includes(term)) {
|
||||
searchResults.push($scope.items[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user