Merge branch 'MDL-73556-master' of https://github.com/ferranrecio/moodle

This commit is contained in:
Jun Pataleta 2022-03-24 23:50:07 +08:00
commit c1c52cfddd
8 changed files with 66 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -480,23 +480,12 @@ define(['jquery'], function($) {
};
/**
* Handle a click (select).
* Handle an item click.
*
* @method handleClick
* @param {Event} e The event.
* @param {Event} event the click event
* @param {jQuery} item the item clicked
*/
Tree.prototype.handleClick = function(e) {
if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
// Do nothing.
return;
}
// Get the closest tree item from the event target.
var item = $(e.target).closest('[role="treeitem"]');
if (!item.is(e.currentTarget)) {
return;
}
Tree.prototype.handleItemClick = function(event, item) {
// Update the active item.
item.focus();
@ -506,6 +495,27 @@ define(['jquery'], function($) {
}
};
/**
* Handle a click (select).
*
* @method handleClick
* @param {Event} event The event.
*/
Tree.prototype.handleClick = function(event) {
if (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey) {
// Do nothing.
return;
}
// Get the closest tree item from the event target.
var item = $(event.target).closest('[role="treeitem"]');
if (!item.is(event.currentTarget)) {
return;
}
this.handleItemClick(event, item);
};
/**
* Handle a focus event.
*