Skip to content

Commit

Permalink
Fixed null reference and layout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeckx committed May 19, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d121564 commit 75dae34
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -176,8 +176,8 @@

groupX += item.width;
if (groupX >= this.columns) {
if (rows[groupY].cells.some(cell => cell.rowSpan === 0)) {
const totalRowHeight = Enumerable.from(rows[groupY].cells).max(cell => cell.rowSpan);
if (rows[groupY].cells.some(cell => cell && cell.rowSpan === 0)) {
const totalRowHeight = Enumerable.from(rows[groupY].cells.filter(c => !!c)).max(cell => cell.rowSpan);
rows[groupY].cells.forEach(cell => {
if (!cell.rowSpan)
cell.rowSpan = totalRowHeight;
@@ -215,8 +215,10 @@
rows.forEach(r => {
for (let i = columns - 1; i >= 0; i--) {
if (!r.cells[i])
r.host.appendChild(document.createElement("td"));
r.cells[i] = document.createElement("td");
}

r.cells.filter(c => !c.parentElement || c.parentElement === r.host).forEach(c => r.host.appendChild(c));
});

if (this._layout)

0 comments on commit 75dae34

Please sign in to comment.