Skip to content

Commit 42ec4d8

Browse files
3x faster rendering
1 parent ad6c511 commit 42ec4d8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

source/js/PivotView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,18 +424,22 @@ PivotView.prototype.recalculateSizes = function (container) {
424424
tableBlock = container.getElementsByClassName("lpt-tableBlock")[0],
425425
tableTr = tableBlock.getElementsByTagName("tr")[0],
426426
headerW = leftHeader.offsetWidth,
427-
headerH = topHeader.offsetHeight;
427+
headerH = topHeader.offsetHeight,
428+
tableBlockParent;
428429

429430
headerContainer.style.width = headerW + "px";
430431
topHeader.style.marginLeft = headerW + "px";
431432
tableBlock.style.marginLeft = headerW + "px";
432433
leftHeader.style.height = container.offsetHeight - headerH + "px";
433434
tableBlock.style.height = container.offsetHeight - headerH + "px";
434435

436+
tableBlockParent = tableBlock.parentNode;
437+
tableBlockParent.removeChild(tableBlock);
435438
for (var i in tableTr.childNodes) {
436439
if (tableTr.childNodes[i].tagName !== "TD") continue;
437440
tableTr.childNodes[i].style.width = topTableTr.childNodes[i].offsetWidth + "px";
438441
}
442+
tableBlockParent.appendChild(tableBlock);
439443

440444
} catch (e) {
441445
console.error("Error when fixing sizes. Please, contact the developer.", "ERROR:", e);

0 commit comments

Comments
 (0)