32 lines
562 B
JavaScript
32 lines
562 B
JavaScript
export class ToolbarGroup {
|
|
sim = undefined;
|
|
toolbars = [];
|
|
|
|
constructor(sim) {
|
|
this.sim = sim;
|
|
const div = document.createElement('div');
|
|
this.div = div;
|
|
this.sim.div.appendChild(div);
|
|
}
|
|
|
|
topRight() {
|
|
this.div.style.position = 'fixed';
|
|
this.div.style.top = '0px';
|
|
this.div.style.right = '0px';
|
|
return this;
|
|
}
|
|
|
|
addToolbar(toolbar) {
|
|
this.div.appendChild(toolbar.div);
|
|
this.toolbars.push(toolbar);
|
|
return this;
|
|
}
|
|
|
|
frame() {
|
|
for (let toolbar of this.toolbars) {
|
|
toolbar.frame();
|
|
}
|
|
}
|
|
}
|
|
|