Skip to content

Commit

Permalink
refactor: fullscreen.js -> fullscreen.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Aug 7, 2023
1 parent ba65fa3 commit 41a0dae
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ui/fullscreen.js → src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as $j from 'jquery';

export class Fullscreen {
constructor(fullscreenElement, fullscreenMode) {
fullscreenElement: any;

constructor(fullscreenElement, fullscreenMode = false) {
this.fullscreenElement = fullscreenElement;
if (fullscreenMode) {
fullscreenElement.addClass('fullscreenMode');
Expand All @@ -21,8 +23,14 @@ export class Fullscreen {
}
}

const isNativeFullscreenAPIUse = () =>
document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement;
const isNativeFullscreenAPIUse = () => {
// NOTE: These properties were vendor-prefixed until very recently.
// Keeping vendor prefixes, though they make TS report an error.
return (
// @ts-expect-error 2551
document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement
);
};

const disableFullscreenLayout = (fullscreenElement) => {
fullscreenElement.removeClass('fullscreenMode');
Expand Down

0 comments on commit 41a0dae

Please sign in to comment.