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

use element.classList.add/remove for a cleaner implementation.

parent eb731930
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ 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";
document.body.classList.add("MB-lightBG");
try {
await this.props.dispatch(fetchDashboard(this.props.selectedDashboard));
......@@ -37,7 +37,7 @@ 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 , '');
document.body.classList.remove("MB-lightBG");
}
render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment