Doceditor: update calculate height for aside and backdrop
This commit is contained in:
parent
b6079b38f2
commit
dd321b125a
@ -78,13 +78,10 @@ const useRootInit = ({ documentType }: UseRootInitProps) => {
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// need for separate window in desktop editors
|
// need for separate window in desktop editors
|
||||||
if (window.AscDesktopEditor) {
|
if (window.AscDesktopEditor) {
|
||||||
const viewPort = window.AscDesktopEditor.getViewportSettings?.();
|
window.AscDesktopEditor.attachEvent?.(
|
||||||
|
"onViewportSettingsChanged",
|
||||||
if (!viewPort || !viewPort?.isEditor) return;
|
calculateAsideHeight,
|
||||||
|
);
|
||||||
window.AscDesktopEditor.onViewportSettingsChanged = () => {
|
|
||||||
calculateAsideHeight();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
};
|
};
|
||||||
|
@ -228,7 +228,7 @@ export const calculateAsideHeight = () => {
|
|||||||
|
|
||||||
if (!viewPort) return;
|
if (!viewPort) return;
|
||||||
|
|
||||||
if (viewPort.isEditor && viewPort.isSeparateWindow) {
|
if (viewPort.widgetType === "window") {
|
||||||
const { captionHeight } = viewPort;
|
const { captionHeight } = viewPort;
|
||||||
const backdrop = document.getElementsByClassName(
|
const backdrop = document.getElementsByClassName(
|
||||||
"backdrop-active",
|
"backdrop-active",
|
||||||
@ -238,7 +238,7 @@ export const calculateAsideHeight = () => {
|
|||||||
if (aside && backdrop) {
|
if (aside && backdrop) {
|
||||||
backdrop.style.height =
|
backdrop.style.height =
|
||||||
aside.style.height = `calc(100dvh - ${captionHeight}px`;
|
aside.style.height = `calc(100dvh - ${captionHeight}px`;
|
||||||
aside.style.top = `${captionHeight}px`;
|
backdrop.style.marginTop = aside.style.top = `${captionHeight}px`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user