summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-09 12:15:35 +0000
committeralecpl <alec@alec.pl>2010-03-09 12:15:35 +0000
commit4d81544057bae4fcacaa20b629a159f625c7de4d (patch)
treed14a708dbfed302df0d8b7027d2d4c919f748452
parent69a7d3127e647e366d608de1713de44c9873ec99 (diff)
- messages list performance: build subject link on client side
-rw-r--r--program/js/app.js10
-rw-r--r--program/steps/mail/func.inc5
2 files changed, 11 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 754954afd..abad6ec6a 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3900,7 +3900,15 @@ function rcube_webmail()
col.className = 'icon';
col.innerHTML = icon ? '<img src="'+icon+'" alt="" />' : '';
row.appendChild(col);
-
+
+ // build subject link
+ if (!bw.ie && cols.subject) {
+ var action = cols.mbox == this.env.drafts_mailbox ? 'compose' : 'show';
+ var uid_param = cols.mbox == this.env.drafts_mailbox ? '_draft_uid' : '_uid';
+ cols.subject = '<a href="./?_task=mail&_action='+action+'&_mbox='+urlencode(cols.mbox)+'&'+uid_param+'='+uid+'"'+
+ ' onclick="return rcube_event.cancel(event)">'+cols.subject+'</a>';
+ }
+
// add each submitted col
for (var n = 0; n < this.coltypes.length; n++) {
var c = this.coltypes[n];
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 3777dfded..101a978cd 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -440,11 +440,10 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $replace=TRUE)
$cont = Q(rcmail_address_string($header->$col, 3), 'show');
else if ($col=='subject')
{
- $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show';
- $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draft_uid' : '_uid';
$cont = abbreviate_string(trim($IMAP->decode_header($header->$col)), 160);
if (!$cont) $cont = rcube_label('nosubject');
- $cont = $browser->ie ? Q($cont) : sprintf('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), Q($cont));
+ $cont = Q($cont);
+ $a_msg_cols['mbox'] = $mbox;
}
else if ($col=='size')
$cont = show_bytes($header->$col);