From 6c9d496fcc44a1d36299fb1d107d49e53858104c Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 30 May 2010 07:48:15 +0000 Subject: - 'threads' column made movable --- program/js/app.js | 18 +++++++++--------- program/steps/mail/func.inc | 21 +++++++++++++++++---- 2 files changed, 26 insertions(+), 13 deletions(-) (limited to 'program') diff --git a/program/js/app.js b/program/js/app.js index dcc212071..3921fab9b 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -166,7 +166,7 @@ function rcube_webmail() this.message_list = new rcube_list_widget(this.gui_objects.messagelist, { multiselect:true, multiexpand:true, draggable:true, keyboard:true, - column_movable:this.env.col_movable, column_fixed:0, dblclick_time:this.dblclick_time + column_movable:this.env.col_movable, dblclick_time:this.dblclick_time }); this.message_list.row_init = function(o){ p.init_message_row(o); }; this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); }); @@ -1645,11 +1645,6 @@ function rcube_webmail() tree += icon ? '' : ''; - // first col is always there - col.className = 'threads'; - col.innerHTML = expando; - row.appendChild(col); - // build subject link if (!bw.ie && cols.subject) { var action = flags.mbox == this.env.drafts_mailbox ? 'compose' : 'show'; @@ -1671,6 +1666,8 @@ function rcube_webmail() else if(!flags.flagged && this.env.unflaggedicon) html = ''; } + else if (c == 'threads') + html = expando; else if (c == 'attachment') html = flags.attachment && this.env.attachmenticon ? '' : ' '; else if (c == 'subject') @@ -1733,12 +1730,15 @@ function rcube_webmail() newcols[newcols.length] = name; delete cols[idx]; } + else if (name == 'threads') { + delete oldcols[i]; + } } for (i=0; i= 0) { this.set_env('subject_col', found); if (this.message_list) - this.message_list.subject_col = found+1; + this.message_list.subject_col = found; } if ((found = $.inArray('flag', this.env.coltypes)) >= 0) this.set_env('flagged_col', found); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index b07e3a6d9..384074b71 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -171,6 +171,10 @@ function rcmail_message_list($attrib) && (($f = array_search('from', $a_show_cols)) !== false) && array_search('to', $a_show_cols) === false) $a_show_cols[$f] = 'to'; + // make sure 'threads' column is present + if (!in_array('threads', $a_show_cols)) + array_unshift($a_show_cols, 'threads'); + $skin_path = $_SESSION['skin_path'] = $CONFIG['skin_path']; // set client env @@ -238,6 +242,10 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $head_replace=FAL && (($f = array_search('from', $a_show_cols)) !== false) && array_search('to', $a_show_cols) === false) $a_show_cols[$f] = 'to'; + // make sure 'threads' column is present + if (!in_array('threads', $a_show_cols)) + array_unshift($a_show_cols, 'threads'); + $thead = $head_replace ? rcmail_message_list_head($_SESSION['list_attrib'], $a_show_cols) : NULL; $OUTPUT->command('set_message_coltypes', $a_show_cols, $thead); @@ -245,10 +253,12 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $head_replace=FAL if (empty($a_headers)) return; - // remove 'attachment' and 'flag' columns, we don't need them here - if(($key = array_search('attachment', $a_show_cols)) !== FALSE) + // remove 'threads', 'attachment', 'flag' columns, we don't need them here + if (($key = array_search('attachment', $a_show_cols)) !== FALSE) unset($a_show_cols[$key]); - if(($key = array_search('flag', $a_show_cols)) !== FALSE) + if (($key = array_search('flag', $a_show_cols)) !== FALSE) + unset($a_show_cols[$key]); + if (($key = array_search('threads', $a_show_cols)) !== FALSE) unset($a_show_cols[$key]); // loop through message headers @@ -345,7 +355,7 @@ function rcmail_message_list_head($attrib, $a_show_cols) else $list_menu = ''; - $cells = array(array('className' => 'threads', 'html' => $list_menu)); + $cells = array(); foreach ($a_show_cols as $col) { // get column name @@ -356,6 +366,9 @@ function rcmail_message_list_head($attrib, $a_show_cols) case 'attachment': $col_name = sprintf($image_tag, $skin_path, $attrib['attachmenticon'], ''); break; + case 'threads': + $col_name = $list_menu; + break; default: $col_name = Q(rcube_label($col)); } -- cgit v1.2.3