WIP: Fill in some of the 'load scenario' tests

This commit is contained in:
2024-06-12 13:29:09 -07:00
parent ac8eb25ac0
commit 2d30b5f842
2 changed files with 89 additions and 10 deletions

View File

@@ -280,16 +280,21 @@ document.querySelector('#upload-save').addEventListener('click', () => {
document.querySelector('input[type="file"]').addEventListener('change', e => {
const [file] = fileInputEl.files;
const reader = new FileReader();
let reader = new FileReader();
reader.onload = function () {
const parser = new DOMParser();
const doc = parser.parseFromString(reader.result, "image/svg+xml");
buildScenario(doc);
mapResourceEl.addEventListener(
'transitionend',
() => buildScenario(doc),
{ once: true }
);
};
mapPlaceholder.style.opacity = 1;
mapResourceEl.style.opacity = 0;
reader.readAsText(file);
});