Skip to content

Commit 32b6b4c

Browse files
another horizontal seek size fix
1 parent eb3b31d commit 32b6b4c

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
// if cellDrillThrough callback returns boolean false, DrillThrough won't be performed.
103103
//, cellDrillThrough: function ({Object { event: {event}, filters: {string[]} }}) {}
104104
}
105-
, pagination: 30 // Enables pagination. Pass a number of lines to show by page.
105+
//, pagination: 30 // Enables pagination. Pass a number of lines to show by page.
106106
//, hideButtons: true // hides "back" and "drillThrough" buttons
107107
//, triggerEvent: "touchstart" // all "click" events will be replaced by this event
108108
//, caption: "My table" // if set, table basic caption will be replaced by this text

source/css/LightPivot.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@
295295
animation-delay: -0.4s;
296296
}
297297

298-
::-webkit-scrollbar-corner {
299-
background-color: #F0F0F0;
300-
}
301-
302298
@-webkit-keyframes lpt-stretch {
303299
0%, 40%, 100% {
304300
-webkit-transform: scaleY(0.4);
@@ -357,4 +353,8 @@
357353
-o-transform: scaleY(1.0);
358354
transform: scaleY(1.0);
359355
}
356+
}
357+
358+
.lpt-tableBlock::-webkit-scrollbar-corner {
359+
background-color: #F0F0F0;
360360
}

source/js/DataSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ DataSource.prototype.getCurrentData = function (callback) {
158158

159159
var data = ready.data;
160160

161-
console.log("Retrieved data:", ready);
161+
//console.log("Retrieved data:", ready);
162162

163163
if (mdxType === "drillthrough") {
164164
callback((function (data) {

source/js/PivotView.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,9 @@ PivotView.prototype.recalculateSizes = function (container) {
437437
headerH = topHeader.offsetHeight,
438438
containerHeight = container.offsetHeight,
439439
mainHeaderWidth = headerContainer.offsetWidth,
440-
hasVerticalScrollBar = Math.max(lTableHead.offsetHeight, pTableHead.offsetHeight)
441-
> containerHeight - headerH - pagedHeight,
442-
addExtraLeftHeaderCell = lTableHead.offsetHeight > containerHeight - headerH - pagedHeight
443-
&& this.SCROLLBAR_WIDTH > 0,
444-
cell, tr, cellWidths = [], columnHeights = [], i;
440+
addExtraLeftHeaderCell = lTableHead.offsetHeight
441+
> containerHeight - headerH - pagedHeight && this.SCROLLBAR_WIDTH > 0,
442+
cell, tr, cellWidths = [], columnHeights = [], i, hasVerticalScrollBar;
445443

446444
headerContainer.style.width = headerW + "px";
447445
if (container["_primaryColumns"]) {
@@ -461,10 +459,6 @@ PivotView.prototype.recalculateSizes = function (container) {
461459

462460
container.parentNode.removeChild(container); // detach
463461

464-
if (hasVerticalScrollBar && cellWidths[cellWidths.length - 1]) {
465-
cellWidths[cellWidths.length - 1] -= this.SCROLLBAR_WIDTH;
466-
}
467-
468462
topHeader.style.marginLeft = headerW + "px";
469463
tableBlock.style.marginLeft = headerW + "px";
470464
leftHeader.style.height = containerHeight - headerH - pagedHeight + "px";
@@ -504,6 +498,17 @@ PivotView.prototype.recalculateSizes = function (container) {
504498

505499
containerParent.appendChild(container); // attach
506500

501+
hasVerticalScrollBar = Math.max(lTableHead.offsetHeight, pTableHead.offsetHeight)
502+
> containerHeight - headerH - pagedHeight;
503+
if (hasVerticalScrollBar && tTableHead.childNodes[0]) {
504+
tr = document.createElement("th");
505+
tr.style.minWidth = this.SCROLLBAR_WIDTH + "px";
506+
tr.style.width = this.SCROLLBAR_WIDTH + "px";
507+
tr.rowSpan = tTableHead.childNodes.length;
508+
tr["_extraCell"] = true;
509+
tTableHead.childNodes[0].appendChild(tr);
510+
}
511+
507512
} catch (e) {
508513
console.error("Error when fixing sizes.", "ERROR:", e);
509514
}

0 commit comments

Comments
 (0)