summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-18 10:52:55 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-18 10:52:55 +0200
commit6c647deffce183bc37ac55e3b3ae35eb5922d428 (patch)
tree2819124900a527b6b4b9653bdf6777099d9fb4c2 /program/js
parentfc90c3a7ac1d3c24397faddc8bcca5bd473efcf5 (diff)
Option to disable cursor keyboard navigation on treelist widgets
Diffstat (limited to 'program/js')
-rw-r--r--program/js/treelist.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js
index 1427c2480..99d1dce87 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -45,6 +45,7 @@ function rcube_treelist_widget(node, p)
scroll_step: 5,
scroll_speed: 20,
save_state: false,
+ keyboard: true,
check_droptarget: function(node){ return !node.virtual }
}, p || {});
@@ -735,7 +736,7 @@ function rcube_treelist_widget(node, p)
case 40:
case 63232: // 'up', in safari keypress
case 63233: // 'down', in safari keypress
- var li = container.find(':focus').closest('li');
+ var li = p.keyboard ? container.find(':focus').closest('li') : [];
if (li.length) {
focus_next(li, (mod = keyCode == 38 || keyCode == 63232 ? -1 : 1));
}
@@ -753,9 +754,11 @@ function rcube_treelist_widget(node, p)
return false;
case 9: // Tab
- // jump to last/first item to move focus away from the treelist widget by tab
- var limit = rcube_event.get_modifier(e) == SHIFT_KEY ? 'first' : 'last';
- focus_noscroll(container.find('li[role=treeitem]:has(a)')[limit]().find('a:'+limit));
+ if (p.keyboard) {
+ // jump to last/first item to move focus away from the treelist widget by tab
+ var limit = rcube_event.get_modifier(e) == SHIFT_KEY ? 'first' : 'last';
+ focus_noscroll(container.find('li[role=treeitem]:has(a)')[limit]().find('a:'+limit));
+ }
break;
}