How to use the @deckdeckgo/utils.isMobile function in @deckdeckgo/utils

To help you get started, we’ve selected a few @deckdeckgo/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deckgo / deckdeckgo / studio / src / app / pages / editor / app-editor / app-editor.tsx View on Github external
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;
            }
github deckgo / deckdeckgo / webcomponents / remote / src / components / deckdeckgo-remote / deckdeckgo-remote.tsx View on Github external
return new Promise((resolve) => {
      this.communicationService.emit({
        type: type,
        emitter: DeckdeckgoEventEmitter.DECK,
        length: this.length,
        deck: this.deck,
        mobile: isMobile()
      });

      resolve();
    });
  }
github deckgo / deckdeckgo / webcomponents / inline-editor / src / components / inline-editor / deckdeckgo-inline-editor.tsx View on Github external
private isSticky(): boolean {
    const mobile: boolean = isMobile();

    return (this.stickyDesktop && !mobile) || (this.stickyMobile && mobile);
  }
github deckgo / deckdeckgo / remote / src / app / pages / app-remote / app-remote.tsx View on Github external
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();
        });
    }