How to use the screenfull/dist/screenfull.js.enabled function in screenfull

To help you get started, we’ve selected a few screenfull 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 opf / openproject / frontend / app / components / wp-buttons / wp-zen-mode-toggle-button / wp-zen-mode-toggle-button.component.ts View on Github external
constructor(@Inject(I18nToken) readonly I18n:op.I18n) {
    super(I18n);

    this.activateLabel = I18n.t('js.zen_mode.button_activate');
    this.deactivateLabel = I18n.t('js.zen_mode.button_deactivate');
    let self = this;

    if (screenfull.enabled) {
      screenfull.onchange(function() {
        // This event might get triggered several times for once leaving
        // fullscreen mode.
        if (!screenfull.isFullscreen) {
          self.deactivateZenMode();
        }
      });
    }
  }
github opf / openproject / frontend / app / components / wp-buttons / wp-zen-mode-toggle-button / wp-zen-mode-toggle-button.component.ts View on Github external
private activateZenMode():void {
    WorkPackageZenModeButtonComponent.inZenMode = true;
    angular.element('body').addClass('zen-mode');
    if (screenfull.enabled) {
      screenfull.request();
    }
  }