Clean up
This commit is contained in:
parent
ea0304356f
commit
7c70f15e49
65 changed files with 1127 additions and 1911 deletions
|
|
@ -4,7 +4,7 @@ export class FullScreenHandler {
|
|||
private readonly maximizeButton: HTMLElement,
|
||||
target: HTMLElement
|
||||
) {
|
||||
if (!document.fullscreenEnabled) {
|
||||
if (!document.fullscreenEnabled || typeof target.requestFullscreen !== 'function') {
|
||||
minimizeButton.hidden = true;
|
||||
maximizeButton.hidden = true;
|
||||
return;
|
||||
|
|
@ -13,7 +13,9 @@ export class FullScreenHandler {
|
|||
this.updateButtons();
|
||||
|
||||
addEventListener('fullscreenchange', this.updateButtons.bind(this));
|
||||
maximizeButton.addEventListener('click', () => target.requestFullscreen());
|
||||
maximizeButton.addEventListener('click', () => {
|
||||
void target.requestFullscreen().catch(() => undefined);
|
||||
});
|
||||
minimizeButton.addEventListener('click', () => document.exitFullscreen());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue