From c18b7b920d1fbf96ca7f4d473e71a5622fbf40a8 Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 18 Sep 2008 10:14:16 +0000 Subject: #1484805: fix next/last page buttons when new message is added to the list + remove last message git-svn-id: https://svn.roundcube.net/trunk@1819 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/list.js | 53 +++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 11 deletions(-) (limited to 'roundcubemail/program/js/list.js') diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js index 926d98aa7..6abe6a023 100644 --- a/roundcubemail/program/js/list.js +++ b/roundcubemail/program/js/list.js @@ -290,7 +290,7 @@ click_row: function(e, id) /** - * get next and previous rows that are not hidden + * get next/previous/last rows that are not hidden */ get_next_row: function() { @@ -318,8 +318,24 @@ get_prev_row: function() return new_row; }, +get_last_row: function() +{ + if (this.rowcount) + { + var rows = this.list.tBodies[0].rows; + + for(var 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; +}, + -// selects or unselects the proper row depending on the modifier key pressed +/** + * selects or unselects the proper row depending on the modifier key pressed + */ select_row: function(id, mod_key, with_mouse) { var select_before = this.selection.join(','); @@ -482,21 +498,36 @@ select_all: function(filter) /** - * Unselect all selected rows + * Unselect selected row(s) */ -clear_selection: function() +clear_selection: function(id) { var num_select = this.selection.length; - for (var n=0; n