second lockPageUI runs after there's no codebox anymore

This commit is contained in:
tophf 2017-12-09 19:05:00 +03:00
parent ab98d46baa
commit 443e3a3c7c

View File

@ -463,7 +463,7 @@ function fromMozillaFormat() {
}) })
.then(sectionDivs => { .then(sectionDivs => {
sectionDivs.forEach(div => updateLintReportIfEnabled(div.CodeMirror, 1)); sectionDivs.forEach(div => updateLintReportIfEnabled(div.CodeMirror, 1));
$('.dismiss', popup).onclick(); $('.dismiss').dispatchEvent(new Event('click'));
}) })
.catch(showError) .catch(showError)
.then(() => lockPageUI(false)); .then(() => lockPageUI(false));
@ -483,10 +483,12 @@ function fromMozillaFormat() {
function lockPageUI(locked) { function lockPageUI(locked) {
document.documentElement.style.pointerEvents = locked ? 'none' : ''; document.documentElement.style.pointerEvents = locked ? 'none' : '';
if (popup.codebox) {
popup.classList.toggle('ready', locked ? false : !popup.codebox.isBlank()); popup.classList.toggle('ready', locked ? false : !popup.codebox.isBlank());
popup.codebox.options.readOnly = locked; popup.codebox.options.readOnly = locked;
popup.codebox.display.wrapper.style.opacity = locked ? '.5' : ''; popup.codebox.display.wrapper.style.opacity = locked ? '.5' : '';
} }
}
function showError(errors) { function showError(errors) {
messageBox({ messageBox({