SDA-2057 - Update few styles to fix the title bar overlap (#994)

This commit is contained in:
Kiran Niranjan 2020-05-13 19:09:44 +05:30 committed by GitHub
parent a73e8810b0
commit 92eb99c650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,6 +257,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
private updateTitleBar(): void {
const { isFullScreen, titleBarHeight } = this.state;
const contentWrapper = document.getElementById('content-wrapper');
const appView = document.getElementsByClassName('AppView-root-3')[0] as HTMLElement;
const root = document.getElementById('root');
const railContainer = document.getElementsByClassName('ReactRail-container-2')[0] as HTMLElement;
const railList = document.getElementsByClassName('railList')[0] as HTMLElement;
@ -271,10 +272,19 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
}
if (root) {
const rootChild = root.firstElementChild as HTMLElement;
if (rootChild && rootChild.style && rootChild.style.height === '100vh') {
rootChild.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`;
}
root.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`;
root.style.marginTop = isFullScreen ? '0px' : titleBarHeight;
} else if (contentWrapper) {
contentWrapper.style.marginTop = isFullScreen ? '0px' : titleBarHeight;
}
if (appView) {
appView.style.height = isFullScreen ? '100vh' : `calc(100vh - ${titleBarHeight})`;
}
if (isFullScreen) {
document.body.style.removeProperty('margin-top');
}