123456789101112131415161718192021222324252627282930313233343536373839404142 |
- module INSPECTOR {
- export interface ISoundInteractions {
- setPlaying: (callback: Function) => void;
- }
- /**
- *
- */
- export class SoundInteractions extends AbstractTreeTool {
- private playSound: ISoundInteractions;
- private b: boolean;
- constructor(playSound: ISoundInteractions) {
- super();
- this.playSound = playSound;
- this.b = false;
- this._elem.classList.add('fa-play');
- }
- protected action() {
- super.action();
- this._playSound();
- }
- private _playSound() {
- if (this._elem.classList.contains('fa-play')) {
- this._elem.classList.remove('fa-play');
- this._elem.classList.add('fa-pause');
- }
- else {
- this._elem.classList.remove('fa-pause');
- this._elem.classList.add('fa-play');
- }
- this.playSound.setPlaying(() => {
- this._elem.classList.remove('fa-pause');
- this._elem.classList.add('fa-play');
- });
- }
- }
- }
|