Skip to content
Snippets Groups Projects
Commit eb731930 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

apply a special bg-color class to the body element when the Dashboard...

apply a special bg-color class to the body element when the Dashboard component is on screen to work around some flexbox, chrome, css shenanigans.  sigh.
parent 4a12b90e
Branches
Tags
No related merge requests found
......@@ -21,6 +21,9 @@ export default class Dashboard extends Component {
};
async componentDidMount() {
// HACK: apply a css class to the page body so that we can ensure the bg-color is maintained
document.body.className += " MB-lightBG";
try {
await this.props.dispatch(fetchDashboard(this.props.selectedDashboard));
} catch (error) {
......@@ -32,6 +35,11 @@ export default class Dashboard extends Component {
}
}
componentWillUnmount() {
// HACK: remove our bg-color css applied when component mounts
document.body.className = document.body.className.replace( /(?:^|\s)MB-lightBG(?!\S)/g , '');
}
render() {
let { dashboard } = this.props;
let { error } = this.state;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment