summaryrefslogtreecommitdiff
path: root/plugins/kolab_shortcuts
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-02-19 08:41:23 (GMT)
committerAleksander Machniak <alec@alec.pl>2015-02-19 08:41:23 (GMT)
commit12b7bd885625199639975afbb8c2c2af5fa350a9 (patch)
treefd6c47a27a2b0348625d086bf1a99900cc7ed5ea /plugins/kolab_shortcuts
parent95a85c121680322ad29ceef38d59eef85bfe605e (diff)
downloadroundcubemail-plugins-kolab-12b7bd885625199639975afbb8c2c2af5fa350a9.tar.gz
Correctly implement thread expand and collapse shortcuts
Diffstat (limited to 'plugins/kolab_shortcuts')
-rw-r--r--plugins/kolab_shortcuts/kolab_shortcuts.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/plugins/kolab_shortcuts/kolab_shortcuts.js b/plugins/kolab_shortcuts/kolab_shortcuts.js
index 7f624c3..4111fa7 100644
--- a/plugins/kolab_shortcuts/kolab_shortcuts.js
+++ b/plugins/kolab_shortcuts/kolab_shortcuts.js
@@ -54,8 +54,7 @@ var kolab_shortcuts = {
ctrl: true,
active: function(e) { return rcmail.task == 'mail'; },
action: function(e) {
- var action = $('.collapsed:first', rcmail.gui_objects.messagelist).length ? 'expand' : 'collapse';
- return rcmail.command(action + '-all', '', e.target, e);
+ return rcmail.command('expand-all', '', e.target, e);
}
},
'mail.expand-thread': {
@@ -64,9 +63,28 @@ var kolab_shortcuts = {
action: function(e) {
if (rcmail.message_list) {
var row, uid = rcmail.message_list.get_single_selection();
- console.log(uid);
if (uid && (row = rcmail.message_list.rows[uid])) {
- rcmail.message_list[row.expanded ? 'collapse_all' : 'expand_all'](row);
+ rcmail.message_list.expand_all(row);
+ }
+ }
+ }
+ },
+ 'mail.collapse-all-threads': {
+ key: 44, // Ctrl+,
+ ctrl: true,
+ active: function(e) { return rcmail.task == 'mail'; },
+ action: function(e) {
+ return rcmail.command('collapse-all', '', e.target, e);
+ }
+ },
+ 'mail.collapse-thread': {
+ key: 44, // ,
+ active: function(e) { return rcmail.task == 'mail'; },
+ action: function(e) {
+ if (rcmail.message_list) {
+ var row, uid = rcmail.message_list.get_single_selection();
+ if (uid && (row = rcmail.message_list.rows[uid])) {
+ rcmail.message_list.collapse_all(row);
}
}
}