From 7bda6af5c0b8ebd1d57641f138ad76073a454d76 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 30 Oct 2009 16:27:39 -0600 Subject: [PATCH] Cache preview messages loaded in the background --- imp/js/DimpBase.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 6320499f6..0e0453979 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -1063,11 +1063,14 @@ var DimpBase = { _loadPreviewCallback: function(resp) { - var ppuid, row, search, tmp, + var bg, ppuid, row, search, tmp, pm = $('previewMsg'), r = resp.response, t = $('msgHeadersContent').down('THEAD'); + bg = (this.pp && + (this.pp.imapuid != r.uid || this.pp.view != r.mailbox)); + if (!r.error) { search = this.viewport.getSelection().search({ imapuid: { equal: [ r.uid ] }, view: { equal: [ r.mailbox ] } }); if (search.size()) { @@ -1076,17 +1079,13 @@ var DimpBase = { } } - if (this.pp && - (this.pp.imapuid != r.uid || - this.pp.view != r.mailbox)) { - return; - } - if (r.error || this.viewport.getSelected().size() != 1) { - if (r.error) { - DimpCore.showNotifications([ { type: r.errortype, message: r.error } ]); + if (!bg) { + if (r.error) { + DimpCore.showNotifications([ { type: r.errortype, message: r.error } ]); + } + this.clearPreviewPane(); } - this.clearPreviewPane(); return; } @@ -1096,6 +1095,10 @@ var DimpBase = { this.ppcache[ppuid] = resp; this.ppfifo.push(ppuid); + if (bg) { + return; + } + DimpCore.removeAddressLinks(pm); // Add subject -- 2.11.0