Merge branch 'MDL-83984_master' of https://github.com/santoshndev/moodle

This commit is contained in:
Jun Pataleta
2026-02-03 17:06:57 +08:00
3 changed files with 18 additions and 3 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -151,6 +151,18 @@ class SubPanel {
this.element.dataset.subPanelInitialized = true;
}
/**
* Hides the subpanel when mouse leaves the menu item.
* @param {Event} event
*/
_hideCurrentSubPanel(event) {
// Only hide if not hovering over the menu item or subpanel content.
const related = event.relatedTarget;
if (!this.menuItem.contains(related) && !this.panelContent.contains(related)) {
this.setVisibility(false);
}
}
/**
* Checks if the subpanel has enough space.
*
@@ -223,13 +235,16 @@ class SubPanel {
/**
* Menu item hover out handler.
* @param {Event} event
* @private
*/
_menuItemHoverOutHandler() {
_menuItemHoverOutHandler(event) {
if (this._needSmallSpaceBehaviour()) {
return;
}
this._hideOtherSubPanels();
// Hide subpanel when the menu item itself is not hovered.
this._hideCurrentSubPanel(event);
}
/**