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