From 66a6935a7050be9490780102bd80205f7c1ff6c3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 26 Sep 2022 23:56:19 -0700 Subject: tip refactoring --- src/lib/utils.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib') diff --git a/src/lib/utils.js b/src/lib/utils.js index 80419a45..7c05e7c3 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -137,3 +137,8 @@ export const f = (s, currency) => .replace('CA', ''); export const s = (s) => new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format(s); + +export const toggleFullscreen = (el) => + document.fullscreenElement + ? document.exitFullscreen() + : el.requestFullscreen().catch(console.log); -- cgit v1.2.3