How to use the screenfull.isFullscreen 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 turt2live / matrix-dimension / web / app / elements / fullscreen-button / fullscreen-button.component.ts View on Github external
public ngOnInit(): void {
        // @ts-ignore
        this.listener = screenfull.on("change", () => {
            // @ts-ignore
            this.isFullscreen = screenfull.isFullscreen;
        });
        // @ts-ignore
        this.isFullscreen = screenfull.isFullscreen;
    }
github u-wave / web / src / components / Video / index.js View on Github external
useEffect(() => {
    if (!isFullscreen && screenfull.enabled) {
      // Checking for `enabled` here, because our props have probably changed
      // _after_ exiting fullscreen mode (see `handleFullscreenChange`).
      // This way we don't double-exit.
      if (screenfull.isFullscreen) {
        screenfull.exit();
      }
    }
  }, [isFullscreen]);
github Postleaf / postleaf / source / scripts / edit_post.js View on Github external
function updateToolbar() {
    // View options
    $('[data-zen-mode]').toggleClass('enabled', zenMode);
    if(Screenfull.enabled) {
      $('[data-fullscreen]').toggleClass('enabled', Screenfull.isFullscreen);
    }
    $('[data-word-count]').toggleClass('enabled', wordCount);

    // Undo/redo
    $('[data-editor="command:undo"]').prop('disabled', !contentEditor.hasUndo());
    $('[data-editor="command:redo"]').prop('disabled', !contentEditor.hasRedo());

    // Formats
    $('[data-editor^="format:"]').each(function() {
      let format = $(this).attr('data-editor').split(':')[1];
      $(this).toggleClass('enabled', contentEditor.hasFormat(format));
    });

    // Lists
    $('[data-editor="command:toggleOrderedList"]').toggleClass('enabled', contentEditor.isOrderedList());
    $('[data-editor="command:toggleUnorderedList"]').toggleClass('enabled', contentEditor.isUnorderedList());
github mcuking / vue2react / docs / components / Header / index.tsx View on Github external
const handleClickFullScreen = (): void => {
    if (screenfull && screenfull.enabled) {
      if (screenfull.isFullscreen) {
        screenfull.exit().catch(err => console.log(err));
      } else {
        screenfull.request().catch(err => console.log(err));
      }
    }
  };
github qti3e / slye / frontend / editor / player.tsx View on Github external
handleScreenfull = () => {
    if (this.fullScreen && Screenfull && !Screenfull.isFullscreen) {
      this.props.onExit();
      Screenfull.off("change", this.handleScreenfull);
    }
  };
github matvp91 / indigo-player / src / extensions / FullscreenExtension / FullscreenExtension.ts View on Github external
screenfull.on('change', () => {
        const fullscreen: boolean = screenfull.isFullscreen;

        this.handleDocumentPos(fullscreen);

        this.emit(Events.FULLSCREEN_CHANGE, {
          fullscreen,
        } as IFullscreenEventData);
      });
    }
github ging / ediphy / _editor / components / nav_bar / editor_nav_bar / EditorNavBar.jsx View on Github external
constructor(props) {
        super(props);

        this.state = {
            showGlobalConfig: false,
            showImportFile: false,
            showExport: false,
            isFullScreenOn: screenfull.isFullscreen,
        };

        this.toggleGlobalConfig = this.toggleGlobalConfig.bind(this);
        this.toggleExport = this.toggleExport.bind(this);
    }
github greglobinski / gatsby-starter-personal-blog / src / components / ActionsBar / ActionsBar.js View on Github external
screenfull.on("change", () => {
        this.setState({
          fullscreen: screenfull.isFullscreen
        });
      });
    }
github jossmac / react-images / src / Lightbox.js View on Github external
if (!isOpen) return <span>;

		let offsetThumbnails = 0;
		if (showThumbnails) {
			offsetThumbnails = theme.wrapper.gutter.vertical;
		}

		return (
			
				<div width="" style="{{">
					<header>
					{this.renderImages()}
				</header></div>
				{this.renderThumbnails()}
				{this.renderArrowPrev()}
				{this.renderArrowNext()}
				
			
		);
	}
	renderImages () {</span>