alecpl
2010-05-30 6c9d496fcc44a1d36299fb1d107d49e53858104c
- 'threads' column made movable


4 files modified
59 ■■■■■ changed files
program/js/app.js 18 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 21 ●●●● patch | view | raw | blame | history
skins/default/functions.js 10 ●●●● patch | view | raw | blame | history
skins/default/mail.css 10 ●●●● patch | view | raw | blame | history
program/js/app.js
@@ -166,7 +166,7 @@
          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 @@
    tree += icon ? '<img id="msgicn'+uid+'" src="'+icon+'" alt="" class="msgicon" />' : '';
    // 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 @@
        else if(!flags.flagged && this.env.unflaggedicon)
          html = '<img id="flaggedicn'+uid+'" src="'+this.env.unflaggedicon+'" class="flagicon" alt="" />';
      }
      else if (c == 'threads')
        html = expando;
      else if (c == 'attachment')
        html = flags.attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : '&nbsp;';
      else if (c == 'subject')
@@ -1733,12 +1730,15 @@
          newcols[newcols.length] = name;
          delete cols[idx];
        }
        else if (name == 'threads') {
          delete oldcols[i];
        }
      }
      for (i=0; i<cols.length; i++)
        if (cols[i])
          newcols[newcols.length] = cols[i];
      if (newcols.join() != this.env.coltypes.join()) {
      if (newcols.join() != oldcols.join()) {
        update = 1;
        add_url += '&_cols=' + newcols.join(',');
      }
@@ -4589,7 +4589,7 @@
    var cell, col, n;
    for (n=0; thead && n<this.env.coltypes.length; n++) {
      col = this.env.coltypes[n];
      if ((cell = thead.rows[0].cells[n+1]) && (col=='from' || col=='to')) {
      if ((cell = thead.rows[0].cells[n]) && (col=='from' || col=='to')) {
        // if we have links for sorting, it's a bit more complicated...
        if (cell.firstChild && cell.firstChild.tagName.toLowerCase()=='a') {
          cell.firstChild.innerHTML = this.get_label(this.env.coltypes[n]);
@@ -4614,7 +4614,7 @@
    if ((found = $.inArray('subject', this.env.coltypes)) >= 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);
program/steps/mail/func.inc
@@ -171,6 +171,10 @@
      && (($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 @@
      && (($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 @@
  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 @@
  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 @@
      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));
    }
skins/default/functions.js
@@ -148,7 +148,7 @@
{
  if (typeof show == 'undefined')
    show = obj.is(':visible') ? false : true;
  var ref = rcube_find_object(refname);
  if (show && ref) {
    var pos = $(ref).offset();
@@ -214,7 +214,13 @@
  var ref = rcube_find_object('listmenulink');
  if (show && ref) {
    var pos = $(ref).offset();
    var pos = $(ref).offset(),
      menuwidth = this.listmenu.width(),
      pagewidth = $(document).width();
    if (pagewidth - pos.left < menuwidth && pos.left > menuwidth)
      pos.left = pos.left - menuwidth;
    this.listmenu.css({ left:pos.left, top:(pos.top + ref.offsetHeight + 2)});
    // set form values
    $('input[name="sort_col"][value="'+rcmail.env.sort_col+'"]').attr('checked', 1);
skins/default/mail.css
@@ -743,8 +743,8 @@
#messagelist tr td.attachment,
#messagelist tr td.flag
{
  width: 20px;
  padding: 0px 1px 1px 1px;
  width: 18px;
  padding: 0px 1px 1px 3px;
}
#messagelist tbody td span.branch,
@@ -756,7 +756,7 @@
#messagelist tbody td img.msgicon
{
  margin-right: 2px;
  margin: 0 2px;
}
#messagelist tr td div.collapsed,
@@ -770,12 +770,12 @@
#messagelist tr td div.collapsed
{
  background: url(images/messageactions.png) 1px -91px no-repeat;
  background: url(images/messageactions.png) -1px -91px no-repeat;
}
#messagelist tr td div.expanded
{
  background: url(images/messageactions.png) 1px -109px no-repeat;
  background: url(images/messageactions.png) -1px -109px no-repeat;
}
#messagelist tbody tr td.flag img:hover,