@sgcloud-sgsistemas/base 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -14,11 +14,13 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
14
14
|
const incrementSelected = () => {
|
|
15
15
|
if ($scope.selected === undefined) {
|
|
16
16
|
$scope.selected = [0, 0];
|
|
17
|
-
} else
|
|
18
|
-
|
|
17
|
+
} else {
|
|
18
|
+
let [groupIndex, resultIndex] = $scope.selected;
|
|
19
|
+
|
|
20
|
+
if (resultIndex < $scope.result[groupIndex].children.length - 1) {
|
|
19
21
|
$scope.selected[1] += 1;
|
|
20
|
-
} else
|
|
21
|
-
$scope.selected[0]
|
|
22
|
+
} else {
|
|
23
|
+
$scope.selected[0] = (groupIndex < $scope.result.length - 1) ? groupIndex + 1 : 0;
|
|
22
24
|
$scope.selected[1] = 0;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -26,10 +28,12 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
26
28
|
|
|
27
29
|
const decrementSelected = () => {
|
|
28
30
|
if ($scope.selected !== undefined) {
|
|
29
|
-
|
|
31
|
+
let [groupIndex, resultIndex] = $scope.selected;
|
|
32
|
+
|
|
33
|
+
if (resultIndex > 0) {
|
|
30
34
|
$scope.selected[1] -= 1;
|
|
31
|
-
} else
|
|
32
|
-
$scope.selected[0]
|
|
35
|
+
} else {
|
|
36
|
+
$scope.selected[0] = (groupIndex > 0) ? groupIndex - 1 : $scope.result.length - 1;
|
|
33
37
|
$scope.selected[1] = $scope.result[$scope.selected[0]].children.length - 1;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
@@ -130,7 +134,7 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
130
134
|
}
|
|
131
135
|
});
|
|
132
136
|
// TO-DO (Limitar resultados parando o algoritmo ao chegar no limite de resultados)
|
|
133
|
-
return elements.sort((a, b) => a.
|
|
137
|
+
return elements.sort((a, b) => a.name.length - b.name.length)
|
|
134
138
|
};
|
|
135
139
|
|
|
136
140
|
/* Para cada tipo, faz um elemento no array */
|