From 2ecb7fef5e0e4c716dd771ddef74c5d3d9f7de6c Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Wed, 17 Mar 2010 12:52:16 -0400 Subject: [PATCH] Also select childs when dragging a thread message --- program/js/list.js | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/program/js/list.js b/program/js/list.js index 5764afc..2c53998 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -1007,6 +1007,27 @@ if (!this.draglayer) this.draglayer = $('<div>').attr('id', 'rcmdraglayer').css({ position:'absolute', display:'none', 'z-index':2000 }).appendTo(document.body); + + // also select childs of (collapsed) threads for dragging + var selection = $.merge([], this.selection); + var depth, row, uid, r; + for (var n=0; n < selection.length; n++) { + uid = selection[n]; + if (this.rows[uid].has_children /*&& !this.rows[uid].expanded*/) { + depth = this.rows[uid].depth; + row = this.rows[uid].obj.nextSibling; + while (row) { + if (row.nodeType == 1) { + if ((r = this.rows[row.uid])) { + if (!r.depth || r.depth <= depth) + break; + this.select_row(r.uid, CONTROL_KEY); + } + } + row = row.nextSibling; + } + } + } // get subjects of selected messages var names = ''; -- Gitblit v1.9.1