diff options
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 3 | ||||
-rw-r--r-- | program/js/common.js | 7 | ||||
-rw-r--r-- | program/js/treelist.js | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js index 53eaa4aa8..9c2acfc55 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1669,6 +1669,9 @@ function rcube_webmail() var target = e.target || {}, keyCode = rcube_event.get_keycode(e); + // save global reference for keyboard detection on click events in IE + rcube_event._last_keyboard_event = e; + if (e.keyCode != 27 && (!this.menu_keyboard_active || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')) { return true; } diff --git a/program/js/common.js b/program/js/common.js index 5ac4febce..f4446c21c 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -31,7 +31,6 @@ var CONTROL_KEY = 1; var SHIFT_KEY = 2; var CONTROL_SHIFT_KEY = 3; - /** * Default browser check class * @constructor @@ -287,8 +286,10 @@ cancel: function(evt) is_keyboard: function(e) { return e && ( - (e.mozInputSource && e.mozInputSource == e.MOZ_SOURCE_KEYBOARD) || - (!e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0) + (e.pointerType !== undefined && e.pointerType !== 'mouse') || // IE 11+ + (e.mozInputSource && e.mozInputSource == e.MOZ_SOURCE_KEYBOARD) || // Firefox + (!e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0) || // others + (bw.ie && rcube_event._last_keyboard_event && rcube_event._last_keyboard_event.target == e.target) // hack for IE <= 10 ); }, diff --git a/program/js/treelist.js b/program/js/treelist.js index 958ae81e2..cce4d17fd 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -747,10 +747,16 @@ function rcube_treelist_widget(node, p) if (li.length) { id = dom2id(li); node = indexbyid[id]; - if (node && node.children.length) + if (node && node.children.length && node.collapsed != (keyCode == 37)) toggle(id, rcube_event.get_modifier(e) == SHIFT_KEY); // toggle subtree } 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'; + container.find('li[role=treeitem]:has(a)')[limit]().find('a:'+limit).focus(); + break; } return true; |