kopia lustrzana https://github.com/backface/turtlestitch
optimized table observation
rodzic
ac2e1969c0
commit
09551e33a0
|
@ -314,7 +314,7 @@ List.prototype.columnNames = function () {
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
|
|
||||||
List.prototype.version = function (startRow, rows) {
|
List.prototype.version = function (startRow, rows, startCol, cols) {
|
||||||
var l = Math.min(startRow + rows, this.length()),
|
var l = Math.min(startRow + rows, this.length()),
|
||||||
v = this.lastChanged,
|
v = this.lastChanged,
|
||||||
r,
|
r,
|
||||||
|
@ -324,7 +324,7 @@ List.prototype.version = function (startRow, rows) {
|
||||||
if (r instanceof Costume) {
|
if (r instanceof Costume) {
|
||||||
v = Math.max(v, r.version);
|
v = Math.max(v, r.version);
|
||||||
} else if (r instanceof List) {
|
} else if (r instanceof List) {
|
||||||
v = Math.max(v, r.version(1, r.length()));
|
v = Math.max(v, r.version(startCol, cols));
|
||||||
} else {
|
} else {
|
||||||
v = Math.max(v, r.lastChanged ? r.lastChanged : 0);
|
v = Math.max(v, r.lastChanged ? r.lastChanged : 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -794,8 +794,12 @@ TableMorph.prototype.step = function () {
|
||||||
TableMorph.prototype.update = function () {
|
TableMorph.prototype.update = function () {
|
||||||
var oldCols, oldRows,
|
var oldCols, oldRows,
|
||||||
version = this.table instanceof List ?
|
version = this.table instanceof List ?
|
||||||
this.table.version(this.startRow, this.rows)
|
this.table.version(
|
||||||
: this.table.lastChanged;
|
this.startRow,
|
||||||
|
this.rows,
|
||||||
|
this.startCol,
|
||||||
|
this.columns.length
|
||||||
|
) : this.table.lastChanged;
|
||||||
if (this.tableVersion === version && !this.wantsUpdate) {
|
if (this.tableVersion === version && !this.wantsUpdate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue