Skip to content

Commit

Permalink
fix link click
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbowen committed Mar 5, 2024
1 parent 67442c9 commit f93d45a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ class SphereWithRods {
window.addEventListener('click', this.toggleFullScreen.bind(this), false);
}

toggleFullScreen(): void {
toggleFullScreen(event: MouseEvent): void {
// ignore clicks on links
if ((event.target as HTMLElement).tagName === 'A') {
return;
}

if (!document.fullscreenElement) {
if (document.body.requestFullscreen) {
document.body.requestFullscreen();
}
document.body.requestFullscreen?.();
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
document.exitFullscreen?.();
}
}

Expand Down

0 comments on commit f93d45a

Please sign in to comment.