Merge branch 'MDL-80391-master-int' of https://github.com/stevandoMoodle/moodle
This commit is contained in:
+1
-1
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user