Commit 99ee38ce by Torkel Ödegaard

feat(tablepanel): minor change

parent d06b9401
......@@ -7,7 +7,7 @@
<thead>
<tr>
<th ng-repeat="col in table.columns">
<div class="table-panel-table-header-inner" ng-click="toggleColumnSort(col, $index)">
<div class="table-panel-table-header-inner pointer" ng-click="toggleColumnSort(col, $index)">
{{col.text}}
<span class="table-panel-table-header-controls" ng-if="col.sort">
<i class="fa fa-caret-down" ng-show="col.desc"></i>
......
......@@ -37,9 +37,14 @@ export function tablePanel() {
}
function appendPaginationControls(footerElem) {
var paginationList = $('<ul></ul>');
footerElem.empty();
var pageCount = data.rows.length / panel.pageSize;
var pageCount = Math.ceil(data.rows.length / panel.pageSize);
if (pageCount === 1) {
return;
}
var paginationList = $('<ul></ul>');
for (var i = 0; i < pageCount; i++) {
var pageLinkElem = $('<li><a href="#">' + (i+1) + '</a></li>');
paginationList.append(pageLinkElem);
......@@ -48,7 +53,6 @@ export function tablePanel() {
var nextLink = $('<li><a href="#">»</a></li>');
paginationList.append(nextLink);
footerElem.empty();
footerElem.append(paginationList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment