Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve) => {
const deckgoRemoteElement = this.el.querySelector('deckgo-remote');
if (!deckgoRemoteElement || !window) {
resolve();
return;
}
const config: EnvironmentDeckDeckGoConfig = EnvironmentConfigService.getInstance().get('deckdeckgo');
deckgoRemoteElement.socketUrl = config.socketUrl;
deckgoRemoteElement.addEventListener('event', async ($event) => {
await this.remoteEvent($event)
});
window.addEventListener('resize', debounce(async () => {
await this.initRemoteSize();
}, 300));
await this.initSlidesDidLoadListener();
await this.initDeckMove();
await this.remoteService.init();
this.el.addEventListener('slideDelete', this.onSlideDelete, false);
this.el.addEventListener('slideDidUpdate', this.slideDidUpdate, false);
this.el.addEventListener('pollUpdated', this.pollUpdated, false);
this.el.addEventListener('deckDidChange', this.deckDidChange, false);
resolve();
});
private initWindowResize() {
if (window) {
window.addEventListener('resize', debounce(this.onResizeContent));
}
}
private resetDisplayToolsActivated() {
this.debounceDisplayToolsActivated = debounce(() => {
this.displayToolsActivated = true;
});
}
private removeWindowResize() {
if (window) {
window.removeEventListener('resize', debounce(this.onWindowResize));
}
}
private initWindowResize() {
if (window) {
window.addEventListener('resize', debounce(this.onWindowResize));
}
}
private initWindowResize() {
if (window) {
window.addEventListener('resize', debounce(this.onResizeContent));
}
}
private initWindowResize() {
if (window) {
window.addEventListener('resize', debounce(this.onResizeContent, 500));
}
}
private initWindowResize() {
if (window) {
window.addEventListener('resize', debounce(async () => {
await this.initSlideSize();
await this.slideTo(this.activeIndex);
const toggleFullscreen: boolean = isFullscreen();
await this.hideOrClearMouseCursorTimer(toggleFullscreen);
await this.showHideActionsSlot(toggleFullscreen);
}, 100));
}
}