summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-08-13 18:24:59 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-08-13 18:25:09 +0200
commit48e340a82938a83ff337eadb7d6d64c2b13acffe (patch)
tree1fe94b962d1b9893e7edbce1d9de6256dde043cf /program/js
parent4045cd9266766488500bf038f2360e3b146d6bdc (diff)
Allow focussing treelist item checkboxes with tab and normal list navigation with cursor keys (#1489648)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js1
-rw-r--r--program/js/treelist.js5
2 files changed, 4 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 5a8734772..a8e66e211 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -5745,6 +5745,7 @@ function rcube_webmail()
this.subscription_list = new rcube_treelist_widget(this.gui_objects.subscriptionlist, {
selectable: true,
+ tabexit: false,
id_prefix: 'rcmli',
id_encode: this.html_identifier_encode,
id_decode: this.html_identifier_decode,
diff --git a/program/js/treelist.js b/program/js/treelist.js
index 5e6d326fc..3a1360229 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -46,6 +46,7 @@ function rcube_treelist_widget(node, p)
scroll_speed: 20,
save_state: false,
keyboard: true,
+ tabexit: true,
check_droptarget: function(node) { return !node.virtual; }
}, p || {});
@@ -810,7 +811,7 @@ function rcube_treelist_widget(node, p)
var target = e.target || {},
keyCode = rcube_event.get_keycode(e);
- if (!has_focus || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')
+ if (!has_focus || target.nodeName == 'INPUT' && keyCode != 38 && keyCode != 40 || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')
return true;
switch (keyCode) {
@@ -836,7 +837,7 @@ function rcube_treelist_widget(node, p)
return false;
case 9: // Tab
- if (p.keyboard) {
+ if (p.keyboard && p.tabexit) {
// 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));