mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-77174 core: Modal z-index calc should ignore hidden items
When an AMD dialogue is opened from a YUI dialogue, the YUI dialogue is not actually removed from the DOM, but was counted in z-index calculation. We need to stop including it otherwise nested AMD => YUI => AMD dialogues get broken.
This commit is contained in:
parent
56260354b1
commit
cad1c7d008
3 changed files with 7 additions and 2 deletions
2
lib/amd/build/modal.min.js
vendored
2
lib/amd/build/modal.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
|
@ -644,6 +644,11 @@ export default class Modal {
|
||||||
|
|
||||||
items.each((index, item) => {
|
items.each((index, item) => {
|
||||||
item = $(item);
|
item = $(item);
|
||||||
|
if (!item.is(':visible')) {
|
||||||
|
// Do not include items which are not visible in the z-index calculation.
|
||||||
|
// This is important because some dialogues are not removed from the DOM.
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Note that webkit browsers won't return the z-index value from the CSS stylesheet
|
// Note that webkit browsers won't return the z-index value from the CSS stylesheet
|
||||||
// if the element doesn't have a position specified. Instead it'll return "auto".
|
// if the element doesn't have a position specified. Instead it'll return "auto".
|
||||||
const itemZIndex = item.css('z-index') ? parseInt(item.css('z-index')) : 0;
|
const itemZIndex = item.css('z-index') ? parseInt(item.css('z-index')) : 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue