MDL-71813 filepicker: view file not available using keyboard (Enter)

This commit is contained in:
hiendinh 2021-05-31 17:48:15 +07:00 committed by Hien Dinh
parent 30b8ad51f4
commit ffb403d9b5

View file

@ -290,6 +290,12 @@ YUI.add('moodle-core_filepicker', function(Y) {
Y.bind(callback, options.callbackcontext)(e, e.node.fileinfo);
Y.YUI2.util.Event.stopEvent(e.event)
});
// Simulate click on file not folder.
scope.treeview.subscribe('enterKeyPressed', function(node) {
if (node.children.length === 0) {
Y.one(node.getContentEl()).one('a').simulate('click');
}
});
// TODO MDL-32736 support right click
/*if (options.rightclickcallback) {
scope.treeview.subscribe('dblClickEvent', function(e){