list perf: use documentFragment to add all rows to table in one operation

This commit is contained in:
Oliver Gerlich 2018-07-16 22:26:40 +02:00 committed by Geno
parent 66d8951ad9
commit 043e7225fd
1 changed files with 3 additions and 2 deletions

View File

@ -410,10 +410,11 @@ export class ListView extends View {
nodes = nodes.reverse();
}
var fragment = document.createDocumentFragment();
for (let i = 0; i < nodes.length; i += 1) {
const row = this.renderRow(nodes[i]);
this.tbody.appendChild(row);
}
fragment.appendChild(row);
}
this.tbody.appendChild(fragment);
}
}