kopia lustrzana https://github.com/backface/turtlestitch
optimized table observation
rodzic
ac2e1969c0
commit
09551e33a0
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue