Merge branch 'MDL-80391-master-int' of https://github.com/stevandoMoodle/moodle

This commit is contained in:
Sara Arjona
2024-02-29 08:08:50 +01:00
3 changed files with 16 additions and 10 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+14 -8
View File
@@ -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');
}
});
}
}
});