optimized table observation

pull/89/head
jmoenig 2019-06-04 07:51:32 +02:00
rodzic ac2e1969c0
commit 09551e33a0
2 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -314,7 +314,7 @@ List.prototype.columnNames = function () {
return [];
};
List.prototype.version = function (startRow, rows) {
List.prototype.version = function (startRow, rows, startCol, cols) {
var l = Math.min(startRow + rows, this.length()),
v = this.lastChanged,
r,
@ -324,7 +324,7 @@ List.prototype.version = function (startRow, rows) {
if (r instanceof Costume) {
v = Math.max(v, r.version);
} else if (r instanceof List) {
v = Math.max(v, r.version(1, r.length()));
v = Math.max(v, r.version(startCol, cols));
} else {
v = Math.max(v, r.lastChanged ? r.lastChanged : 0);
}

Wyświetl plik

@ -794,8 +794,12 @@ TableMorph.prototype.step = function () {
TableMorph.prototype.update = function () {
var oldCols, oldRows,
version = this.table instanceof List ?
this.table.version(this.startRow, this.rows)
: this.table.lastChanged;
this.table.version(
this.startRow,
this.rows,
this.startCol,
this.columns.length
) : this.table.lastChanged;
if (this.tableVersion === version && !this.wantsUpdate) {
return;
}