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:
parent
761462e26c
commit
46258f5805
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,12 @@
|
||||||
|
2010-11-03 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
|
* UI/WebServerResources/SOGoDataTable.js (remove): we must
|
||||||
|
decrement the value of renderedIndex when the row removed is
|
||||||
|
before the first rendered row. We also call deselect in order to
|
||||||
|
update the internal array of selected rows IDs.
|
||||||
|
(refresh): new method to force the recomputation of the top and
|
||||||
|
bottom padding rows of the table.
|
||||||
|
|
||||||
2010-11-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-11-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* Tests/Integration/teststrings.sh: new utility script to test the
|
* Tests/Integration/teststrings.sh: new utility script to test the
|
||||||
|
@ -60,7 +69,7 @@
|
||||||
|
|
||||||
* UI/WebServerResources/generic.js (triggerAjaxRequest): invoke
|
* UI/WebServerResources/generic.js (triggerAjaxRequest): invoke
|
||||||
the request callback only when set on the http object.
|
the request callback only when set on the http object.
|
||||||
|
|
||||||
* SoObjects/Mailer/SOGoMailBaseObject.m (-_createIMAP4Connection):
|
* SoObjects/Mailer/SOGoMailBaseObject.m (-_createIMAP4Connection):
|
||||||
we need to initialize newConnection to nil when the return
|
we need to initialize newConnection to nil when the return
|
||||||
password is nil.
|
password is nil.
|
||||||
|
|
|
@ -460,7 +460,7 @@ function deleteSelectedMessagesCallback(http) {
|
||||||
div.update();
|
div.update();
|
||||||
}
|
}
|
||||||
Mailer.dataTable.remove(data["id"][i]);
|
Mailer.dataTable.remove(data["id"][i]);
|
||||||
Mailer.dataTable.render();
|
Mailer.dataTable.refresh();
|
||||||
deleteCachedMailboxByType("trash");
|
deleteCachedMailboxByType("trash");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2325,7 +2325,7 @@ function folderRefreshCallback(http) {
|
||||||
var uids = s.split(",");
|
var uids = s.split(",");
|
||||||
for (var i = 0; i < uids.length; i++)
|
for (var i = 0; i < uids.length; i++)
|
||||||
Mailer.dataTable.remove(uids[i]);
|
Mailer.dataTable.remove(uids[i]);
|
||||||
Mailer.dataTable.render();
|
Mailer.dataTable.refresh();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
refreshCurrentFolder();
|
refreshCurrentFolder();
|
||||||
|
@ -2336,6 +2336,7 @@ function folderRefreshCallback(http) {
|
||||||
// Display hidden rows from move operation
|
// Display hidden rows from move operation
|
||||||
var s = http.callbackData.id + "";
|
var s = http.callbackData.id + "";
|
||||||
var uids = s.split(",");
|
var uids = s.split(",");
|
||||||
|
log ("folderRefreshCallback failed for UIDs " + s);
|
||||||
for (var i = 0; i < uids.length; i++) {
|
for (var i = 0; i < uids.length; i++) {
|
||||||
var row = $("row_" + uids[i]);
|
var row = $("row_" + uids[i]);
|
||||||
if (row)
|
if (row)
|
||||||
|
|
|
@ -136,15 +136,21 @@ var SOGoDataTableInterface = {
|
||||||
return firstRowIndex;
|
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 index = this.firstVisibleRowIndex();
|
||||||
var count = this.visibleRowCount();
|
var count = this.visibleRowCount();
|
||||||
|
|
||||||
// Overflow the query to the maximum defined in the class variable overflow
|
// Overflow the query to the maximum defined in the class variable overflow
|
||||||
var start = index - (this.overflow/2);
|
var start = index - (this.overflow/2);
|
||||||
if (start < 0) start = 0;
|
if (start < 0) start = 0;
|
||||||
var end = index + count + this.overflow - (index - start);
|
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
|
// 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;
|
//if (this.dataSource.uids && this.dataSource.uids.length < end) end = this.dataSource.uids.length;
|
||||||
|
@ -154,7 +160,8 @@ var SOGoDataTableInterface = {
|
||||||
|
|
||||||
this.currentRenderID = index + "-" + count;
|
this.currentRenderID = index + "-" + count;
|
||||||
// Query the data source only if at least one row is not loaded
|
// 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.renderedIndex > index ||
|
||||||
this.renderedCount < count ||
|
this.renderedCount < count ||
|
||||||
(index + count) > (this.renderedIndex + this.renderedCount)) {
|
(index + count) > (this.renderedIndex + this.renderedCount)) {
|
||||||
|
@ -171,7 +178,7 @@ var SOGoDataTableInterface = {
|
||||||
// log ("DataTable._render() ignore render for " + renderID + " (current is " + this.currentRenderID + ")");
|
// log ("DataTable._render() ignore render for " + renderID + " (current is " + this.currentRenderID + ")");
|
||||||
return;
|
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 h, i, j;
|
||||||
var rows = this.body.select("tr");
|
var rows = this.body.select("tr");
|
||||||
|
@ -302,14 +309,17 @@ var SOGoDataTableInterface = {
|
||||||
var rows = this.body.select("TR#row_" + uid);
|
var rows = this.body.select("TR#row_" + uid);
|
||||||
if (rows.length == 1) {
|
if (rows.length == 1) {
|
||||||
var row = rows.first();
|
var row = rows.first();
|
||||||
|
row.deselect();
|
||||||
row.parentNode.removeChild(row);
|
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() {
|
_emptyTable: function() {
|
||||||
|
|
|
@ -129,7 +129,7 @@ SOGoMailDataSource = Class.create({
|
||||||
start = index;
|
start = index;
|
||||||
end = index + count;
|
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++) {
|
for (i = 0, j = start; j < end; j++) {
|
||||||
if (!this.cache.get(this.uids[j])) {
|
if (!this.cache.get(this.uids[j])) {
|
||||||
|
|
Loading…
Reference in a new issue