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

This commit is contained in:
Ilya Tregubov
2023-10-06 11:09:29 +08:00
3 changed files with 23 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
+21 -1
View File
@@ -1642,7 +1642,7 @@ const Tour = class {
});
fader.attr('data-flexitour', 'step-background-fader');
if (targetNode.parents('[data-region="fixed-drawer"]').length || !stepConfig.zIndex) {
if (!stepConfig.zIndex) {
let targetClone = targetNode.clone();
background.append(targetClone.first());
$('body').append(fader);
@@ -1683,6 +1683,9 @@ const Tour = class {
*/
calculateZIndex(elem) {
elem = $(elem);
if (this.requireDefaultTourZindex(elem)) {
return 0;
}
while (elem.length && elem[0] !== document) {
// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this function consistent across browsers
@@ -1704,6 +1707,23 @@ const Tour = class {
return 0;
}
/**
* Check if the element require the default tour z-index.
*
* Some page elements have fixed z-index. However, their weight is not enough to cover
* other page elements like the top navbar or a sticky footer so they use the default
* tour z-index instead.
*
* @param {jQuery} elem the page element to highlight
* @return {Boolean} true if the element requires the default tour z-index instead of the calculated one
*/
requireDefaultTourZindex(elem) {
if (elem.parents('[data-region="fixed-drawer"]').length !== 0) {
return true;
}
return false;
}
/**
* Calculate the inheritted background colour.
*