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) => {
if (!$event) {
resolve();
return;
}
if (!$event.target || !($event.target instanceof HTMLElement)) {
resolve();
return;
}
if ($event instanceof MouseEvent && isMobile()) {
resolve();
return;
}
// Click on the pager
if (!($event.target as HTMLElement).nodeName || ($event.target as HTMLElement).nodeName.toLowerCase() === 'deckgo-deck') {
resolve();
return;
}
// Need to move a bit the mouse first to detect that we want to edit, otherwise we might select the deck with a click without displaying the toolbar footer
if (this.fullscreen && this.presenting) {
resolve();
return;
}
return new Promise((resolve) => {
this.communicationService.emit({
type: type,
emitter: DeckdeckgoEventEmitter.DECK,
length: this.length,
deck: this.deck,
mobile: isMobile()
});
resolve();
});
}
private isSticky(): boolean {
const mobile: boolean = isMobile();
return (this.stickyDesktop && !mobile) || (this.stickyMobile && mobile);
}
return new Promise(async (resolve) => {
if ($event && $event.deck) {
const slidesElements: JSX.IntrinsicElements[] = await ParseSlidesUtils.parseSlides($event.deck);
this.slides = [...slidesElements];
this.deckAttributes = await ParseAttributesUtils.parseAttributes($event.deck.attributes);
this.deckRevealOnMobile = !$event.mobile && isMobile() ? $event.deck.reveal : $event.deck.revealOnMobile;
this.deckReveal = $event.deck.reveal;
} else {
this.slides = undefined;
}
resolve();
});
}
componentWillLoad() {
this.mobile = isMobile();
}
return new Promise((resolve) => {
resolve(isMobile());
});
}
async componentDidLoad() {
if (!this.mobile) {
this.mobile = isMobile();
}
}