| 358 | } |
| 359 | |
| 360 | toggleEvents(eventNames, enabled) { |
| 361 | if (this.eventManager) { |
| 362 | eventNames.forEach(eventName => { |
| 363 | if (this._events[eventName] !== enabled) { |
| 364 | this._events[eventName] = enabled; |
| 365 | if (enabled) { |
| 366 | // eslint-disable-next-line @typescript-eslint/unbound-method |
| 367 | this.eventManager.on(eventName, this.handleEvent); |
| 368 | } else { |
| 369 | // eslint-disable-next-line @typescript-eslint/unbound-method |
| 370 | this.eventManager.off(eventName, this.handleEvent); |
| 371 | } |
| 372 | } |
| 373 | }); |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | // Private Methods |
| 378 | |