summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/list.js
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-24 09:47:45 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-24 09:47:45 +0000
commitb16eb8ab3519bb5f32c421c0b53dc493df3cdf56 (patch)
tree24d91f085c140e15ed512f513b70092369647b61 /roundcubemail/program/js/list.js
parent5ccb2b88ddec6daa6f78ab29a6f18b888184b548 (diff)
Only select childs when a message row is collapsed but also do it when deleting a thread
git-svn-id: https://svn.roundcube.net/trunk@3411 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/list.js')
-rw-r--r--roundcubemail/program/js/list.js40
1 files changed, 25 insertions, 15 deletions
diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js
index c5267eeb3..614d9c3c7 100644
--- a/roundcubemail/program/js/list.js
+++ b/roundcubemail/program/js/list.js
@@ -658,6 +658,29 @@ select_first: function()
this.select_row(first_row, false, false);
},
+/**
+ * Add all childs of the given row to selection
+ */
+select_childs: function(uid)
+{
+ if (!this.rows[uid] || !this.rows[uid].has_children)
+ return;
+
+ var depth = this.rows[uid].depth;
+ var 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;
+ if (!this.in_selection(r.uid))
+ this.select_row(r.uid, CONTROL_KEY);
+ }
+ }
+ row = row.nextSibling;
+ }
+},
+
/**
* Perform selection when shift key is pressed
@@ -1013,21 +1036,8 @@ drag_mouse_move: function(e)
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;
- if (!this.in_selection(r.uid))
- this.select_row(r.uid, CONTROL_KEY);
- }
- }
- row = row.nextSibling;
- }
- }
+ if (this.rows[uid].has_children && !this.rows[uid].expanded)
+ this.select_childs(uid);
}
// get subjects of selected messages