Merge branch 'dev' into ns2_recompile_stale_deps

This commit is contained in:
J 2019-06-02 23:03:20 -04:00 committed by GitHub
commit 8817d179c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 17 deletions

@ -38,10 +38,10 @@ export async function executeJSScript(scripts = [], workerScript) {
// load fully dynamic content. So we hide the import from webpack
// by placing it inside an eval call.
urls = _getScriptUrls(script, scripts, []);
script.module = await eval('import(urls[urls.length - 1].url)');
script.module = new Promise(resolve => resolve(eval('import(urls[urls.length - 1].url)')));
script.dependencies = urls.map(u => u.filename);
}
loadedModule = script.module;
loadedModule = await script.module;
let ns = workerScript.env.vars;

@ -1,3 +1,5 @@
import { KEY } from "./helpers/keyCodes";
/**
* Create and display a pop-up dialog box.
* This dialog box does not allow for any interaction and should close when clicking
@ -9,28 +11,31 @@ let dialogBoxes = [];
$(document).click(function(event) {
if (dialogBoxOpened && dialogBoxes.length >= 1) {
if (!$(event.target).closest(dialogBoxes[0]).length){
dialogBoxes[0].remove();
dialogBoxes.splice(0, 1);
if (dialogBoxes.length == 0) {
dialogBoxOpened = false;
} else {
dialogBoxes[0].style.visibility = "visible";
}
closeTopmostDialogBox();
}
}
});
function closeTopmostDialogBox() {
if (!dialogBoxOpened || dialogBoxes.length === 0) return;
dialogBoxes[0].remove();
dialogBoxes.shift();
if (dialogBoxes.length == 0) {
dialogBoxOpened = false;
} else {
dialogBoxes[0].style.visibility = "visible";
}
}
// Dialog box close buttons
$(document).on('click', '.dialog-box-close-button', function( event ) {
if (dialogBoxOpened && dialogBoxes.length >= 1) {
dialogBoxes[0].remove();
dialogBoxes.splice(0, 1);
if (dialogBoxes.length == 0) {
dialogBoxOpened = false;
} else {
dialogBoxes[0].style.visibility = "visible";
}
closeTopmostDialogBox();
});
document.addEventListener("keydown", function (event) {
if (event.keyCode == KEY.ESC && dialogBoxOpened) {
closeTopmostDialogBox();
event.preventDefault();
}
});