diff --git a/htdocs/js/apps/PGProblemEditor/pgproblemeditor.js b/htdocs/js/apps/PGProblemEditor/pgproblemeditor.js index ec32e886bb..062cf4950c 100644 --- a/htdocs/js/apps/PGProblemEditor/pgproblemeditor.js +++ b/htdocs/js/apps/PGProblemEditor/pgproblemeditor.js @@ -1,18 +1,18 @@ (function () { - document.addEventListener('keydown', (e) => { - if (e.key === 'Escape') bsModal.hide(); - }); - const bsModal = new bootstrap.Modal(document.getElementById('render-modal'), { keyboard: true, show: false }); let busyIndicator = null; - const frame = document.getElementById('pg_editor_frame_id'); - frame?.addEventListener('load', () => { + const removeBusyIndicator = () => { if (busyIndicator) { busyIndicator.remove(); busyIndicator = null; } + }; + + const frame = document.getElementById('pg_editor_frame_id'); + frame?.addEventListener('load', () => { + removeBusyIndicator(); if (frame.contentDocument.URL == 'about:blank') return; const style = frame.contentDocument.createElement('style'); style.type = 'text/css'; @@ -42,8 +42,19 @@ busyIndicator = document.createElement('div'); busyIndicator.classList.add('page-loading-busy-indicator'); busyIndicator.innerHTML = '