From ac4cbfc4269da0c94198fd908cbc8b6df543d423 Mon Sep 17 00:00:00 2001 From: alec Date: Tue, 18 May 2010 07:39:31 +0000 Subject: - Added threads tree icons - css/js fixes and improvements in (messages) list code git-svn-id: https://svn.roundcube.net/trunk@3625 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/list.js | 77 +++++++++++++++------------------------- 1 file changed, 28 insertions(+), 49 deletions(-) (limited to 'roundcubemail/program/js/list.js') diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js index 480cc6243..42149d6a1 100644 --- a/roundcubemail/program/js/list.js +++ b/roundcubemail/program/js/list.js @@ -76,11 +76,10 @@ init: function() this.rows = []; this.rowcount = 0; - var row, r; + var r, len, rows = this.list.tBodies[0].rows; - for (r=0; r=0; i--) - if(rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) - - return RegExp.$1; + for (i=rows.length-1; i>=0; i--) + if (rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) + return RegExp.$1; } return null; @@ -756,15 +751,14 @@ shift_select: function(id, control) if (!this.rows[this.shift_start] || !this.selection.length) this.shift_start = id; - var from_rowIndex = this.rows[this.shift_start].obj.rowIndex; - var to_rowIndex = this.rows[id].obj.rowIndex; - - var i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex); - var j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex); + var from_rowIndex = this.rows[this.shift_start].obj.rowIndex, + to_rowIndex = this.rows[id].obj.rowIndex, + i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex), + j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex); // iterate through the entire message list for (var n in this.rows) { - if ((this.rows[n].obj.rowIndex >= i) && (this.rows[n].obj.rowIndex <= j)) { + if (this.rows[n].obj.rowIndex >= i && this.rows[n].obj.rowIndex <= j) { if (!this.in_selection(n)) { this.highlight_row(n, true); } @@ -804,11 +798,11 @@ select_all: function(filter) this.selection = []; for (var n in this.rows) { - if (!filter || (this.rows[n] && this.rows[n][filter] == true)) { + if (!filter || this.rows[n][filter] == true) { this.last_selected = n; this.highlight_row(n, true); } - else if (this.rows[n]) { + else { $(this.rows[n].obj).removeClass('selected').removeClass('unfocused'); } } @@ -856,7 +850,7 @@ clear_selection: function(id) // one row if (id) { - for (var n=0; n12) { names += '...'; @@ -1372,20 +1365,6 @@ column_replace: function(from, to) this.subject_col = to > from ? to - 1 : to; this.triggerEvent('column_replace'); -}, - - -/** - * Creating the list in background - */ -set_background_mode: function(flag) -{ - if (flag) { - this.background = document.createElement('tbody'); - } else if (this.background) { - this.list.replaceChild(this.background, this.list.tBodies[0]); - this.background = null; - } } }; -- cgit v1.2.3