mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-80391 tiny_html: Fixed multi modal layer display
This commit is contained in:
parent
48049499d2
commit
ec7bd6035c
2
lib/editor/tiny/amd/build/editor.min.js
vendored
2
lib/editor/tiny/amd/build/editor.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
@ -508,20 +508,26 @@ export const setupForTarget = async(target, options = {}) => {
|
||||
|
||||
// If the editor is in a modal, we need to hide the modal when window editor's window is opened.
|
||||
editor.on('OpenWindow', () => {
|
||||
if (isModalMode(target)) {
|
||||
const modal = document.querySelector('[data-region="modal"]');
|
||||
if (!modal.classList.contains('hide')) {
|
||||
modal.classList.add('hide');
|
||||
}
|
||||
const modals = document.querySelectorAll('[data-region="modal"]');
|
||||
if (modals) {
|
||||
modals.forEach((modal) => {
|
||||
if (!modal.classList.contains('hide')) {
|
||||
modal.classList.add('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// If the editor's window is closed, we need to show the hidden modal back.
|
||||
editor.on('CloseWindow', () => {
|
||||
if (isModalMode(target)) {
|
||||
const modal = document.querySelector('[data-region="modal"]');
|
||||
if (modal.classList.contains('hide')) {
|
||||
modal.classList.remove('hide');
|
||||
const modals = document.querySelectorAll('[data-region="modal"]');
|
||||
if (modals) {
|
||||
modals.forEach((modal) => {
|
||||
if (modal.classList.contains('hide')) {
|
||||
modal.classList.remove('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user