Skip to content

Commit

Permalink
Merge branch 'MDL-79927' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Jan 25, 2024
2 parents 5d9cd39 + 24f59a7 commit 59cac76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/form/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ M.form_filemanager.init = function(Y, options) {
return this.filemanager.ancestor('.fitem.disabled') != null;
},
getSelectedFiles: function() {
var markedFiles = this.filemanager.all('[data-togglegroup=file-selections]:checked');
var markedFiles = this.filemanager.all('[data-togglegroup][data-toggle=slave]:checked');
var filenames = [];
markedFiles.each(function(item) {
var fileinfo = this.options.list.find(function(element) {
Expand Down
9 changes: 4 additions & 5 deletions repository/filepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,14 @@ YUI.add('moodle-core_filepicker', function(Y) {
*/
var formatCheckbox = function(o) {
var el = Y.Node.create('<div/>');

var parentid = scope.one('.' + classname).get('id');
var checkbox = Y.Node.create('<input/>')
.setAttribute('type', 'checkbox')
.setAttribute('data-fieldtype', 'checkbox')
.setAttribute('data-fullname', o.data.fullname)
.setAttribute('data-action', 'toggle')
.setAttribute('data-toggle', 'slave')
.setAttribute('data-togglegroup', 'file-selections')
.setAttribute('data-toggle-selectall', M.util.get_string('selectall', 'moodle'))
.setAttribute('data-toggle-deselectall', M.util.get_string('deselectall', 'moodle'));
.setAttribute('data-togglegroup', 'file-selections-' + parentid);

var checkboxLabel = Y.Node.create('<label>')
.setHTML("Select file '" + o.data.fullname + "'")
Expand Down Expand Up @@ -384,12 +382,13 @@ YUI.add('moodle-core_filepicker', function(Y) {

// Generate a checkbox based on toggleall's specification
var div = Y.Node.create('<div/>');
var parentid = scope.one('.' + classname).get('id');
var checkbox = Y.Node.create('<input/>')
.setAttribute('type', 'checkbox')
// .setAttribute('title', M.util.get_string('selectallornone', 'form'))
.setAttribute('data-action', 'toggle')
.setAttribute('data-toggle', 'master')
.setAttribute('data-togglegroup', 'file-selections');
.setAttribute('data-togglegroup', 'file-selections-' + parentid);

var checkboxLabel = Y.Node.create('<label>')
.setHTML(M.util.get_string('selectallornone', 'form'))
Expand Down

0 comments on commit 59cac76

Please sign in to comment.