fixing issue with list not sorting

This commit is contained in:
Shelby Sturgis 2016-03-16 21:52:23 -07:00
parent 041c2f6f41
commit 6939960230
2 changed files with 3 additions and 3 deletions

View file

@ -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) {

View file

@ -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>