fixing issue with list not sorting
This commit is contained in:
parent
041c2f6f41
commit
6939960230
|
@ -18,7 +18,7 @@ module.directive('paginatedSelectableList', function (kbnUrl) {
|
|||
controller: function ($scope, $element, $filter) {
|
||||
$scope.perPage = $scope.perPage || 10;
|
||||
|
||||
$scope.hits = $scope.list || [];
|
||||
$scope.hits = $scope.list.sort() || [];
|
||||
|
||||
$scope.hitCount = $scope.hits.length;
|
||||
|
||||
|
@ -36,7 +36,7 @@ module.directive('paginatedSelectableList', function (kbnUrl) {
|
|||
*/
|
||||
$scope.sortHits = function (hits) {
|
||||
$scope.isAscending = !$scope.isAscending;
|
||||
$scope.list = $scope.isAscending ? hits.sort() : hits.reverse();
|
||||
$scope.hits = $scope.isAscending ? hits.sort() : hits.reverse();
|
||||
};
|
||||
|
||||
$scope.makeUrl = function (hit) {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</li>
|
||||
<li
|
||||
class="list-group-item list-group-menu-item"
|
||||
ng-repeat="hit in page | filter: query | orderBy: hit.toString()">
|
||||
ng-repeat="hit in page | filter: query">
|
||||
<a ng-if="userMakeUrl" kbn-href="{{makeUrl(hit)}}">
|
||||
<span>{{hit}}</span>
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue