Skip to content

Commit

Permalink
Merge pull request #15 from gilemon/fixOlderBlocksFromThisDate
Browse files Browse the repository at this point in the history
fix/Older blocks from this date navigation
  • Loading branch information
Alex-Werner authored Apr 7, 2018
2 parents 4ffbafa + 1d6fa4d commit 597e528
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions public/src/js/controllers/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ angular.module('insight.blocks').controller('BlocksController',
$scope.loading = false;
$scope.blocks = res.blocks;
$scope.pagination = res.pagination;
$scope.pagination.olderBlocks = $scope.pagination.moreTs;
for (var key in $scope.blocks)
{
if($scope.blocks[key].time < $scope.pagination.olderBlocks) $scope.pagination.olderBlocks = $scope.blocks[key].time;
}
});
};

Expand Down
4 changes: 2 additions & 2 deletions public/views/block_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ <h1>
</tbody>
</table>
<div data-ng-if="pagination.more">
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}" data-ng-show="{{before}}">Lastest block from date</a>
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}/{{pagination.moreTs}}">Older blocks from this date</a>
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}" data-ng-show="before">Lastest block from date</a>
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}/{{pagination.olderBlocks}}">Older blocks from this date</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 597e528

Please sign in to comment.