Skip to content

Commit

Permalink
implement optimization from #166
Browse files Browse the repository at this point in the history
  • Loading branch information
krausest committed Apr 22, 2017
1 parent 5d7a88e commit ee0a610
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
11 changes: 6 additions & 5 deletions vanillajs-keyed/src/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ class Main {
this.rows.splice(idx, 1);
this.data.splice(idx, 1);
this.unselect();

this.recreateSelection();
stopMeasure();
}
Expand Down Expand Up @@ -283,13 +282,15 @@ class Main {
}
clear() {
startMeasure("clear");
this.removeAllRows();
this.store.clear();
this.rows = [];
this.data = [];
this.unselect();
stopMeasure();
}
requestAnimationFrame(() => {
this.removeAllRows();
this.unselect();
stopMeasure();
});
}
swapRows() {
startMeasure("swapRows");
if (this.data.length>10) {
Expand Down
10 changes: 6 additions & 4 deletions vanillajs-non-keyed/src/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,15 @@ class Main {
}
clear() {
startMeasure("clear");
this.removeAllRows();
this.store.clear();
this.rows = [];
this.data = [];
this.unselect();
stopMeasure();
}
requestAnimationFrame(() => {
this.removeAllRows();
this.unselect();
stopMeasure();
});
}
swapRows() {
startMeasure("swapRows");
let old_selection = this.store.selected;
Expand Down
4 changes: 2 additions & 2 deletions webdriver-ts/table.html

Large diffs are not rendered by default.

0 comments on commit ee0a610

Please sign in to comment.