Navigate with arrow keys only in treelist widgets; fix keyboard event detection in IE; new text label to help screen readers

pull/195/head
Thomas Bruederli 11 years ago
parent 3445ca1a4f
commit bf33799377

@ -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;
}

@ -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
);
},

@ -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;

@ -586,6 +586,7 @@ $labels['chinese'] = 'Chinese';
$labels['arialabeltopnav'] = 'Window control';
$labels['arialabeltasknav'] = 'Application tasks';
$labels['arialabeltoolbar'] = 'Application toolbar';
$labels['arialabelactivetask'] = 'Active task';
$labels['arialabelmessagessearchfilter'] = 'Email listing filter';
$labels['arialabelmailsearchform'] = 'Email message search form';
$labels['arialabelcontactsearchform'] = 'Contacts search form';

Loading…
Cancel
Save