Commit b2bbba1e authored by Oleksii Savran's avatar Oleksii Savran

Page shakes

parent 32fef883
......@@ -320,7 +320,7 @@ class MapPage extends React.Component<IMapPageProps, any> {
return;
}
if (document) {
document.body.classList.add('modal-open');
document.documentElement.classList.add('modal-open');
}
return this.setState({climateData: res, dialogOpened: true});
})
......@@ -359,7 +359,7 @@ class MapPage extends React.Component<IMapPageProps, any> {
private hideDialog = () => {
this.setState({dialogOpened: false});
if (document) {
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
}
}
......
......@@ -41,7 +41,7 @@ const styles = (theme) => ({
const BioClimateDisplay = ({climateData, t, extraFilters, applyClimateFilters, inModal = false, classes, ...rest}: WithTranslation & {climateData: TileClimate, extraFilters?: any, applyClimateFilters: any, inModal?: boolean, classes: any}) => {
const doFilters = () => {
console.log(`Applying climate filters`, climateData, extraFilters);
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
setTimeout(() => applyClimateFilters(climateData, extraFilters), 10);
};
......
......@@ -54,17 +54,17 @@ class TreeModal extends React.Component<ITreeProps, any> {
const {open} = nextProps;
if (document) {
if (open !== this.props.open && open) {
document.body.classList.add('modal-open');
document.documentElement.classList.add('modal-open');
}
if (open !== this.props.open && !open) {
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
}
}
}
public componentWillUnmount() {
if (document) {
document.body.classList.remove('modal-open');
document.documentElement.classList.remove('modal-open');
}
}
......
......@@ -16,6 +16,7 @@ html {
font-size: $base-font-size;
margin: 0;
padding: 0;
overflow-y: scroll !important;
}
body {
......@@ -23,7 +24,6 @@ body {
padding: 0 !important;
margin: 0;
background: #f8f8f8;
overflow-y: scroll !important;
}
a,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment