use fullscreen polyfill
This commit is contained in:
parent
242e0cdc19
commit
a2b48ccc34
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ import usePrevious from 'effects/use-previous';
|
||||||
import { FILE_WRAPPER_CLASS } from 'page/file/view';
|
import { FILE_WRAPPER_CLASS } from 'page/file/view';
|
||||||
import Draggable from 'react-draggable';
|
import Draggable from 'react-draggable';
|
||||||
import Tooltip from 'component/common/tooltip';
|
import Tooltip from 'component/common/tooltip';
|
||||||
|
import { onFullscreenChange } from 'util/full-screen';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
mediaType: string,
|
mediaType: string,
|
||||||
|
@ -98,10 +99,10 @@ export default function FileViewer(props: Props) {
|
||||||
if (inline) {
|
if (inline) {
|
||||||
handleResize();
|
handleResize();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
window.addEventListener('fullscreenchange', handleResize);
|
onFullscreenChange(window, 'add', handleResize);
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('resize', handleResize);
|
window.removeEventListener('resize', handleResize);
|
||||||
window.removeEventListener('fullscreenchange', handleResize);
|
onFullscreenChange(window, 'remove', handleResize);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [setFileViewerRect, inline]);
|
}, [setFileViewerRect, inline]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue