summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-05 16:44:35 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-05 16:44:35 +0200
commitbf33799377eab662f8f25365cf15f57cf6697947 (patch)
tree064e960000b124b1c3089b4a14497636d196f387
parent3445ca1a4fbfa7a141872ecf1a5f59649b101ec9 (diff)
Navigate with arrow keys only in treelist widgets; fix keyboard event detection in IE; new text label to help screen readers
-rw-r--r--program/js/app.js3
-rw-r--r--program/js/common.js7
-rw-r--r--program/js/treelist.js8
-rw-r--r--program/localization/en_US/labels.inc1
4 files changed, 15 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 6d66aa2c0..ddc7b2f4b 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;
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index e7d385fe6..5a1f2fca0 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -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';