See Changelog.

Monotone-Parent: eeede995522aac10418121af680e6cf94cb7bb4a
Monotone-Revision: 50723500f3fd2e527f835f55eb94a6a5f7413e40

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-11-03T20:53:13
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle committed 2010-11-03 20:53:13 +00:00
1 parent 761462e26c
commit 46258f5805
4 files changed
+35 -15

No files matched your search

+3 -2
View File
@@ -460,7 +460,7 @@ function deleteSelectedMessagesCallback(http) {
div.update();
}
Mailer.dataTable.remove(data["id"][i]);
Mailer.dataTable.render();
Mailer.dataTable.refresh();
deleteCachedMailboxByType("trash");
}
else {
@@ -2325,7 +2325,7 @@ function folderRefreshCallback(http) {
var uids = s.split(",");
for (var i = 0; i < uids.length; i++)
Mailer.dataTable.remove(uids[i]);
Mailer.dataTable.render();
Mailer.dataTable.refresh();
}
else
refreshCurrentFolder();
@@ -2336,6 +2336,7 @@ function folderRefreshCallback(http) {
// Display hidden rows from move operation
var s = http.callbackData.id + "";
var uids = s.split(",");
log ("folderRefreshCallback failed for UIDs " + s);
for (var i = 0; i < uids.length; i++) {
var row = $("row_" + uids[i]);
if (row)
+21 -11
View File
@@ -136,15 +136,21 @@ var SOGoDataTableInterface = {
return firstRowIndex;
},
render: function() {
refresh: function() {
this.render(true);
},
render: function(refresh) {
// Setting "refresh" to true will force the call to getData which
// recomputes the top and bottom padding with respect to the total
// number of rows.
var index = this.firstVisibleRowIndex();
var count = this.visibleRowCount();
// Overflow the query to the maximum defined in the class variable overflow
var start = index - (this.overflow/2);
if (start < 0) start = 0;
var end = index + count + this.overflow - (index - start);
// log ("DataTable.getData() from " + index + " to " + (index + count) + " boosted from " + start + " to " + end);
// log ("DataTable.render() from " + index + " to " + (index + count) + " boosted from " + start + " to " + end);
// Don't overflow above the maximum number of entries from the data source
//if (this.dataSource.uids && this.dataSource.uids.length < end) end = this.dataSource.uids.length;
@@ -154,7 +160,8 @@ var SOGoDataTableInterface = {
this.currentRenderID = index + "-" + count;
// Query the data source only if at least one row is not loaded
if (this.renderedIndex < 0 ||
if (refresh === true ||
this.renderedIndex < 0 ||
this.renderedIndex > index ||
this.renderedCount < count ||
(index + count) > (this.renderedIndex + this.renderedCount)) {
@@ -171,7 +178,7 @@ var SOGoDataTableInterface = {
// log ("DataTable._render() ignore render for " + renderID + " (current is " + this.currentRenderID + ")");
return;
}
// log("DataTable._render() for " + data.length + " uids (from " + start + ")");
// log("DataTable._render() for " + data.length + " uids (from " + start + ", max " + max + ")");
var h, i, j;
var rows = this.body.select("tr");
@@ -302,14 +309,17 @@ var SOGoDataTableInterface = {
var rows = this.body.select("TR#row_" + uid);
if (rows.length == 1) {
var row = rows.first();
row.deselect();
row.parentNode.removeChild(row);
var index = this.dataSource.remove(uid);
// log ("DataTable.remove(" + uid + ")");
if (this.renderedIndex < index &&
(this.renderedIndex + this.renderedCount) > index) {
this.renderedCount--;
}
}
var index = this.dataSource.remove(uid);
// log ("DataTable.remove(" + uid + ") at index " + index);
if (this.renderedIndex > index)
this.renderedIndex--;
else if ((this.renderedIndex + this.renderedCount) > index)
this.renderedCount--;
return index;
},
_emptyTable: function() {
+1 -1
View File
@@ -129,7 +129,7 @@ SOGoMailDataSource = Class.create({
start = index;
end = index + count;
}
// log ("MailDataSource._getData() from " + index + " to " + (index + count) + " boosted from " + start + " to " + end);
// log ("MailDataSource._getData() from " + index + " to " + (index + count) + " boosted from " + start + " to " + end);
for (i = 0, j = start; j < end; j++) {
if (!this.cache.get(this.uids[j])) {