Browse Source

add grw-drawer-opened class to body

Yuki Takei 5 years ago
parent
commit
05f7ee9456
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/client/js/services/NavigationContainer.js

+ 10 - 0
src/client/js/services/NavigationContainer.js

@@ -111,6 +111,16 @@ export default class NavigationContainer extends Container {
   toggleDrawer() {
     const { isDrawerOpened } = this.state;
     this.setState({ isDrawerOpened: !isDrawerOpened });
+
+    // TODO: remove adding/removing classes after Reactify
+    const body = document.body;
+    const isOpenedInNewState = !isDrawerOpened;
+    if (isOpenedInNewState) {
+      body.classList.add('grw-drawer-opened');
+    }
+    else {
+      body.classList.remove('grw-drawer-opened');
+    }
   }
 
   /**