From a2b48ccc341b1cd5f75d009df167b47b4739e9dc Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Sun, 13 Oct 2019 16:28:12 -0600 Subject: [PATCH] use fullscreen polyfill --- src/ui/component/fileViewer/view.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/component/fileViewer/view.jsx b/src/ui/component/fileViewer/view.jsx index d980d7ce2..5485f738d 100644 --- a/src/ui/component/fileViewer/view.jsx +++ b/src/ui/component/fileViewer/view.jsx @@ -11,6 +11,7 @@ import usePrevious from 'effects/use-previous'; import { FILE_WRAPPER_CLASS } from 'page/file/view'; import Draggable from 'react-draggable'; import Tooltip from 'component/common/tooltip'; +import { onFullscreenChange } from 'util/full-screen'; type Props = { mediaType: string, @@ -98,10 +99,10 @@ export default function FileViewer(props: Props) { if (inline) { handleResize(); window.addEventListener('resize', handleResize); - window.addEventListener('fullscreenchange', handleResize); + onFullscreenChange(window, 'add', handleResize); return () => { window.removeEventListener('resize', handleResize); - window.removeEventListener('fullscreenchange', handleResize); + onFullscreenChange(window, 'remove', handleResize); }; } }, [setFileViewerRect, inline]);