Skip to content

Commit b46fea3

Browse files
Wrong size detect when "showSizes" option is on and there is 1 page
1 parent 6ccc1ec commit b46fea3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.4.10",
4+
"version": "1.4.11",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {

source/js/PivotView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ PivotView.prototype.recalculateSizes = function (container) {
672672
pTableHead = tableBlock.getElementsByTagName("tbody")[0],
673673
searchInput = container.getElementsByClassName("lpt-searchInput")[0],
674674
searchInputSize = searchInput ? container.offsetWidth - this.SEARCHBOX_LEFT_MARGIN : 0,
675-
tableTr = tableBlock.getElementsByTagName("tr")[0];
675+
tableTr = tableBlock.getElementsByTagName("tr")[0],
676+
pageSwitcher = container.getElementsByClassName("lpt-pageSwitcher")[0];
676677

677678
if (tTableHead.childNodes[0] && tTableHead.childNodes[0].lastChild["_extraCell"]) {
678679
tTableHead.childNodes[0].removeChild(tTableHead.childNodes[0].lastChild);
@@ -681,7 +682,7 @@ PivotView.prototype.recalculateSizes = function (container) {
681682
lTableHead.removeChild(lTableHead.lastChild);
682683
}
683684

684-
var pagedHeight = (this.pagination.on ? this.PAGINATION_BLOCK_HEIGHT : 0)
685+
var pagedHeight = (pageSwitcher ? this.PAGINATION_BLOCK_HEIGHT : 0)
685686
+ (this.SEARCH_ENABLED ? this.PAGINATION_BLOCK_HEIGHT : 0),
686687
headerW = Math.max(leftHeader.offsetWidth, headerContainer.offsetWidth),
687688
headerH = topHeader.offsetHeight;

0 commit comments

Comments
 (0)