Home Reference Source Repository

src/app/core/models/components/component.js

import { menu as Menu } from "../../application/menu";
import { app as App } from "../../../app";
export class Component {
  constructor(drawer, options) {
    this.options = options;
    this.states;
    this.drawer;
    this.state;
    this.setDrawer(drawer);
    this._bootstrap();
  }
  _bootstrap() {
    if (this.options == undefined) return;
    Menu.add(this);
  }
  setDrawer(drawer) {
    this.drawer = drawer;
  }
  draw(e) {
    this.drawer.draw(e);
  }
  click() {
    this.state = undefined;
    App.setSelectedTool(this);
    this.draw();
  }
}