mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-73556-master' of https://github.com/ferranrecio/moodle
This commit is contained in:
commit
c1c52cfddd
8 changed files with 66 additions and 21 deletions
2
lib/amd/build/tree.min.js
vendored
2
lib/amd/build/tree.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue