summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-05-31 11:12:04 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-05-31 11:12:04 +0000
commit3bd3b519e80923d075eda705a1c50d01de22536c (patch)
tree2510823abc75a1e93b4c64ffeb9844d34ae073a9 /roundcubemail/program/js
parent4b63a58ffa073eec25b7672a673ade54ee779ad3 (diff)
- Added possibility to invert messages selection
git-svn-id: https://svn.roundcube.net/trunk@2581 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/app.js5
-rw-r--r--roundcubemail/program/js/list.js24
2 files changed, 28 insertions, 1 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 18a4f1ae3..5e323e229 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -826,7 +826,10 @@ function rcube_webmail()
break;
case 'select-all':
- this.message_list.select_all(props);
+ if (props == 'invert')
+ this.message_list.invert_selection();
+ else
+ this.message_list.select_all(props);
break;
case 'select-none':
diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js
index addd1e652..51889fa30 100644
--- a/roundcubemail/program/js/list.js
+++ b/roundcubemail/program/js/list.js
@@ -530,6 +530,30 @@ select_all: function(filter)
/**
+ * Invert selection
+ */
+invert_selection: function()
+{
+ if (!this.rows || !this.rows.length)
+ return false;
+
+ // remember old selection
+ var select_before = this.selection.join(',');
+
+ for (var n in this.rows)
+ this.highlight_row(n, true);
+
+ // trigger event if selection changed
+ if (this.selection.join(',') != select_before)
+ this.triggerEvent('select');
+
+ this.focus();
+
+ return true;
+},
+
+
+/**
* Unselect selected row(s)
*/
clear_selection: function(id)