See Changelog

Monotone-Parent: 870b4c8a5782c840ff0aa2f075ea7594bda50e59
Monotone-Revision: 39d36001db32af64db061e377168a6c1bc81941d

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-11-10T14:57:55
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-11-10 14:57:55 +00:00
parent 99f5614b7d
commit 65fe5727b5
4 changed files with 39 additions and 19 deletions
+5
View File
@@ -1,3 +1,8 @@
2010-11-10 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/MailerUI.js (openMailbox): improved
behavior when reloading the mailbox.
2010-11-08 Ludovic Marcotte <lmarcotte@inverse.ca>
* SOPE/GDLContentStore/GCSAlarmsFolder.m
+32 -16
View File
@@ -730,28 +730,44 @@ function openMailbox(mailbox, reload) {
key += "?" + p;
}
var dataSource = Mailer.dataSources.get(key);
if (!dataSource) {
dataSource = new SOGoMailDataSource(Mailer.dataTable, url);
if (inboxData) {
dataSource.init(inboxData['uids'], inboxData['headers']);
inboxData = null; // invalidate this initial lookup
}
else
dataSource.load(urlParams);
Mailer.dataSources.set(key, dataSource);
getUnseenCountForFolder(mailbox);
}
else if (reload) {
if (reload) {
// Don't change data source, only query UIDs from server and refresh
// the view. Cases that end up here:
// - performed a search
// - clicked on Get Mail button
urlParams.set("no_headers", "1");
dataSource.load(urlParams);
}
if (reload)
Mailer.dataTable.load(urlParams);
Mailer.dataTable.refresh();
}
else {
var dataSource = Mailer.dataSources.get(key);
if (!dataSource) {
// Data source is not cached
dataSource = new SOGoMailDataSource(Mailer.dataTable, url);
if (inboxData) {
// Use UIDs and headers from the WOX template; this only
// happens once and only with the inbox
dataSource.init(inboxData['uids'], inboxData['headers']);
inboxData = null; // invalidate this initial lookup
}
else
// Fetch UIDs and headers from server
dataSource.load(urlParams);
// Cache data source
Mailer.dataSources.set(key, dataSource);
// Update unseen count
getUnseenCountForFolder(mailbox);
}
else {
// Data source is cached, query only UIDs from server
urlParams.set("no_headers", "1");
dataSource.load(urlParams);
}
// Associate data source with data table and render the view
Mailer.dataTable.setSource(dataSource);
Mailer.dataTable.render();
}
configureDraggables();
Mailer.currentMailbox = mailbox;
+1 -1
View File
@@ -180,7 +180,7 @@ var SOGoDataTableInterface = {
_render: function(renderID, start, max, data, refresh) {
if (this.currentRenderID != renderID) {
// log ("DataTable._render() ignore render for " + renderID + " (current is " + this.currentRenderID + ")");
// log ("DataTable._render() ignore render for " + renderID + " (current is " + this.currentRenderID + ")");
return;
}
// log("DataTable._render() for " + data.length + " uids (from " + start + ", max " + max + ")");
+1 -2
View File
@@ -84,7 +84,6 @@ SOGoMailDataSource = Class.create({
this.init(data.uids, data.headers);
else
this.init(data);
this.loaded = true;
if (this.delayedGetData) {
this.delayedGetData();
this.delayedGetData = false;
@@ -99,7 +98,7 @@ SOGoMailDataSource = Class.create({
getData: function(id, index, count, callbackFunction, delay) {
if (this.loaded == false) {
// UIDs are not yet loaded -- delay the call until loading the data is completed.
// log ("MailDataSource.getData() delaying data fetching while waiting for UIDs");
// log ("MailDataSource.getData() delaying data fetching while waiting for UIDs");
this.delayedGetData = this.getData.bind(this, id, index, count, callbackFunction, delay);
return;
}