mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-77957-404-test2' of https://github.com/rezaies/moodle into MOODLE_404_STABLE
This commit is contained in:
commit
35b9ad6bbf
2
theme/boost/amd/build/drawers.min.js
vendored
2
theme/boost/amd/build/drawers.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
@ -778,7 +778,10 @@ const registerListeners = () => {
|
||||
drawerMap.forEach(drawerInstance => {
|
||||
disableDrawerTooltips(drawerInstance.drawerNode);
|
||||
if (drawerInstance.isOpen) {
|
||||
if (drawerInstance.closeOnResize) {
|
||||
const currentFocus = document.activeElement;
|
||||
const drawerContent = drawerInstance.drawerNode.querySelector(SELECTORS.DRAWERCONTENT);
|
||||
const shouldClose = drawerInstance.closeOnResize && (!drawerContent || !drawerContent.contains(currentFocus));
|
||||
if (shouldClose) {
|
||||
drawerInstance.closeDrawer();
|
||||
} else {
|
||||
anyOpen = true;
|
||||
@ -798,6 +801,12 @@ const registerListeners = () => {
|
||||
};
|
||||
|
||||
document.addEventListener('scroll', () => {
|
||||
const currentFocus = document.activeElement;
|
||||
const drawerContentElements = document.querySelectorAll(SELECTORS.DRAWERCONTENT);
|
||||
// Check if the current focus is within any drawer content.
|
||||
if (Array.from(drawerContentElements).some(drawer => drawer.contains(currentFocus))) {
|
||||
return;
|
||||
}
|
||||
const body = document.querySelector('body');
|
||||
if (window.scrollY >= window.innerHeight) {
|
||||
body.classList.add(CLASSES.SCROLLED);
|
||||
|
Loading…
x
Reference in New Issue
Block a user