testbed: mount agents in a seperate div
mostly to test that works
This commit is contained in:
parent
7e1999f117
commit
d5b7e174a1
2 changed files with 7 additions and 2 deletions
|
@ -24,5 +24,8 @@
|
|||
<input type="submit" value="Load"/>
|
||||
</form>
|
||||
</div>
|
||||
<!-- This is where all Agents go -->
|
||||
<div id="agent-mount">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -6,6 +6,8 @@ let w = window as any;
|
|||
w.agents = [];
|
||||
let input = document.getElementById("testbed-input") as HTMLInputElement;
|
||||
|
||||
let mount = document.getElementById("agent-mount") as HTMLDivElement;
|
||||
|
||||
input.addEventListener("change", async () => {
|
||||
let buffer = await input.files![0].arrayBuffer();
|
||||
|
||||
|
@ -14,7 +16,7 @@ input.addEventListener("change", async () => {
|
|||
|
||||
w.agents.push(agent);
|
||||
|
||||
agent.addToDom(document.body);
|
||||
agent.addToDom(mount);
|
||||
|
||||
agent.show();
|
||||
console.log("Agent created");
|
||||
|
@ -35,4 +37,4 @@ form.addEventListener('submit', e => {
|
|||
agent.show();
|
||||
console.log(`Loaded agent from ${url}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue