This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch omnibar
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/omnibar by this push:
     new 6c14b41  cleanup
6c14b41 is described below

commit 6c14b4164e58275d8d6cd437222c112fcadb15f9
Author: hughhhh <hmi...@lyft.com>
AuthorDate: Wed Jan 23 19:44:25 2019 -0800

    cleanup
---
 .../assets/src/dashboard/components/Dashboard.jsx  | 31 +++++++++++-----------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx 
b/superset/assets/src/dashboard/components/Dashboard.jsx
index a30b5f4..6bc403e 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -89,7 +89,7 @@ class Dashboard extends React.PureComponent {
     super(props);
     this.state = {
       showOmni: false,
-    }
+    };
 
     this.isFirstLoad = true;
     this.actionLog = new ActionLog({
@@ -109,21 +109,6 @@ class Dashboard extends React.PureComponent {
     document.addEventListener('keydown', this.handleKeydown);
   }
 
-  componentWillUnmount() {
-    document.removeEventListener('keydown', this.handleKeydown);
-  }
-
-  handleKeydown(event) {
-    console.log('presing some key....');
-    const controlOrCommand = event.ctrlKey || event.metaKey;
-    if (controlOrCommand) {
-      const isK = event.key === 'k' || event.keyCode === 83;
-      if (isK) {
-        this.setState({ showOmni: !this.state.showOmni })
-      }
-    }
-  }
-
   componentWillReceiveProps(nextProps) {
     if (!nextProps.dashboardState.editMode) {
       // log pane loads
@@ -227,11 +212,25 @@ class Dashboard extends React.PureComponent {
     }
   }
 
+  componentWillUnmount() {
+    document.removeEventListener('keydown', this.handleKeydown);
+  }
+
   // return charts in array
   getAllCharts() {
     return Object.values(this.props.charts);
   }
 
+  handleKeydown(event) {
+    const controlOrCommand = event.ctrlKey || event.metaKey;
+    if (controlOrCommand) {
+      const isK = event.key === 'k' || event.keyCode === 83;
+      if (isK) {
+        this.setState({ showOmni: !this.state.showOmni });
+      }
+    }
+  }
+
   refreshExcept(filterKey) {
     const immune = this.props.dashboardInfo.metadata.filter_immune_slices || 
[];
 

Reply via email to