PauseScheduleTool.ts 777 B

12345678910111213141516171819202122232425
  1. import { Inspector } from "../Inspector";
  2. import { Scheduler } from "../scheduler/Scheduler";
  3. import { AbstractTool } from "./AbstractTool";
  4. export class PauseScheduleTool extends AbstractTool {
  5. private _isPause: boolean = false;
  6. constructor(parent: HTMLElement, inspector: Inspector) {
  7. super('fa', 'fa-pause', parent, inspector, 'Pause the automatic update of properties');
  8. }
  9. // Action : refresh the whole panel
  10. public action() {
  11. if (this._isPause) {
  12. Scheduler.getInstance().pause = false;
  13. this._updateIcon('fa-pause');
  14. } else {
  15. Scheduler.getInstance().pause = true;
  16. this._updateIcon('fa-play');
  17. }
  18. this._isPause = !this._isPause;
  19. }
  20. }