MDL-63628 accessibility: Trigger file links with keyboard
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
M.mod_folder = {};
|
||||
|
||||
M.mod_folder.init_tree = function(Y, id, expand_all) {
|
||||
Y.use('yui2-treeview', function(Y) {
|
||||
Y.use('yui2-treeview', 'node-event-simulate', function(Y) {
|
||||
var tree = new Y.YUI2.widget.TreeView(id);
|
||||
|
||||
tree.subscribe("clickEvent", function(node, event) {
|
||||
@@ -33,6 +33,12 @@ M.mod_folder.init_tree = function(Y, id, expand_all) {
|
||||
return false;
|
||||
});
|
||||
|
||||
tree.subscribe("enterKeyPressed", function(node) {
|
||||
// We want keyboard activation to trigger a click on the first link.
|
||||
Y.one(node.getContentEl()).one('a').simulate('click');
|
||||
return false;
|
||||
});
|
||||
|
||||
if (expand_all) {
|
||||
tree.expandAll();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user