cleanup
This commit is contained in:
@@ -4,10 +4,6 @@ export const DOCUMENT_VIEWER_PORTRAIT_HEIGHT_RATIO = 0.4;
|
||||
const PORTRAIT_RATIO_STYLE_ID = 'document-viewer-portrait-ratio-style';
|
||||
|
||||
const ensurePortraitRatioStyle = () => {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
const cssValue = String(DOCUMENT_VIEWER_PORTRAIT_HEIGHT_RATIO);
|
||||
const cssText = `:root { --document-viewer-portrait-height-ratio: ${cssValue}; }`;
|
||||
|
||||
@@ -23,12 +19,7 @@ const ensurePortraitRatioStyle = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const computeStackedLayoutBreakpoint = () => {
|
||||
if (typeof window === 'undefined') {
|
||||
return 900;
|
||||
}
|
||||
return window.innerWidth / 2;
|
||||
};
|
||||
const computeStackedLayoutBreakpoint = () => window.innerWidth / 2;
|
||||
|
||||
export const useViewerLayoutMode = (ref, dependency) => {
|
||||
const [isStacked, setIsStacked] = useState(false);
|
||||
@@ -61,7 +52,7 @@ export const useViewerLayoutMode = (ref, dependency) => {
|
||||
|
||||
measure();
|
||||
|
||||
if (typeof ResizeObserver === 'undefined') {
|
||||
if (!('ResizeObserver' in window)) {
|
||||
window.addEventListener('resize', measure);
|
||||
return () => {
|
||||
if (frame) {
|
||||
|
||||
Reference in New Issue
Block a user