See Changelog

Monotone-Parent: bb6767d882b80a6dcb30d6487153b189ee367d0d
Monotone-Revision: 58cf6fbba1f009a9bedc373454f61ed082ccfae0

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-11-05T21:32:00
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-11-05 21:32:00 +00:00
parent 0aaee17d2b
commit 30c268412e
4 changed files with 60 additions and 21 deletions

View File

@@ -45,12 +45,14 @@ SOGoMailDataSource = Class.create({
init: function(uids, headers) {
this.uids = uids;
var keys = headers[0];
for (var i = 1; i < headers.length; i++) {
var header = [];
for (var j = 0; j < keys.length; j++)
header[keys[j]] = headers[i][j];
this.cache.set(header["uid"], header);
if (headers) {
var keys = headers[0];
for (var i = 1; i < headers.length; i++) {
var header = [];
for (var j = 0; j < keys.length; j++)
header[keys[j]] = headers[i][j];
this.cache.set(header["uid"], header);
}
}
this.loaded = true;
@@ -78,7 +80,10 @@ SOGoMailDataSource = Class.create({
if (http.status == 200) {
if (http.responseText.length > 0) {
var data = http.responseText.evalJSON(true);
this.init(data.uids, data.headers);
if (data.uids)
this.init(data.uids, data.headers);
else
this.init(data);
this.loaded = true;
if (this.delayedGetData) {
this.delayedGetData();