MDL-68576 filepicker: Fix inability to select files in table view

This commit is contained in:
Mihail Geshoski 2020-05-05 16:13:00 +08:00
parent a09eb2697f
commit 1de1fc58f3

View File

@ -390,9 +390,11 @@ YUI.add('moodle-core_filepicker', function(Y) {
div.appendChild(checkboxLabel);
div.appendChild(checkbox);
// Define the selector for the click event handler.
var clickEventSelector = 'tr';
// Enable the selectable checkboxes
if (options.disablecheckboxes != undefined && !options.disablecheckboxes) {
clickEventSelector = 'tr td:not(:first-child)';
cols.unshift({
key: "",
label: div.getContent(),
@ -411,7 +413,7 @@ YUI.add('moodle-core_filepicker', function(Y) {
}
Y.bind(callback, this)(e, record.getAttrs());
}
}, 'tr td:not(:first-child)', options.callbackcontext, scope.tableview);
}, clickEventSelector, options.callbackcontext, scope.tableview);
if (options.rightclickcallback) {
scope.tableview.delegate('contextmenu', function (e, tableview) {