mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-1510 - Add margin top dynamically in mana (#801)
This commit is contained in:
parent
55d667ab46
commit
d6ba2d7a0a
@ -52,6 +52,10 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
if (target) {
|
||||
this.observer.observe(target, { attributes: true, childList: true, subtree: true, characterData: true });
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.updateTitleBar();
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {
|
||||
@ -247,15 +251,29 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
private updateTitleBar(): void {
|
||||
const { isFullScreen, titleBarHeight } = this.state;
|
||||
const contentWrapper = document.getElementById('content-wrapper');
|
||||
if (!contentWrapper) {
|
||||
const root = document.getElementById('root');
|
||||
const railContainer = document.getElementsByClassName('ReactRail-container-2')[0] as HTMLElement;
|
||||
const railList = document.getElementsByClassName('railList')[0] as HTMLElement;
|
||||
if (railContainer) {
|
||||
railContainer.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`;
|
||||
} else if (railList) {
|
||||
railList.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`;
|
||||
}
|
||||
if (!contentWrapper && !root) {
|
||||
document.body.style.marginTop = isFullScreen ? '0px' : titleBarHeight;
|
||||
return;
|
||||
}
|
||||
|
||||
if (root) {
|
||||
root.style.marginTop = isFullScreen ? '0px' : titleBarHeight;
|
||||
} else if (contentWrapper) {
|
||||
contentWrapper.style.marginTop = isFullScreen ? '0px' : titleBarHeight;
|
||||
}
|
||||
if (isFullScreen) {
|
||||
document.body.style.removeProperty('margin-top');
|
||||
}
|
||||
|
||||
document.body.classList.add('sda-title-bar');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,9 +112,7 @@
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
sda-title-bar {
|
||||
.sda-title-bar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user