import { TOOLBAR_CLASSNAME, } from './config.js'; import {Header} from './tool/header.js'; export class Toolbar { sim = undefined; tools = []; constructor(sim, title) { this.sim = sim; // Create ourselves a div, as child of sim's div const div = document.createElement('div'); this.div = div; this.sim.div.appendChild(div); div.classList.add(TOOLBAR_CLASSNAME); // Create a collapse/expand tool const header = new Header(this, title); this.addTool(header); } topRight() { this.div.style.top = '0px'; this.div.style.right = '0px'; return this; } // tool: instance of Tool addTool(tool) { this.div.appendChild(tool.div); this.tools.push(tool); } frame() { for (let tool in this.tools) { // TODO: tool.frame() tool.frame(); } } }