MDL-68576 filepicker: Fix inability to select files in table view
authorMihail Geshoski <mihail@moodle.com>
Tue, 5 May 2020 08:13:00 +0000 (16:13 +0800)
committerMihail Geshoski <mihail@moodle.com>
Fri, 8 May 2020 06:40:36 +0000 (14:40 +0800)
repository/filepicker.js

index e65a202..240147f 100644 (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) {