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 9550a49  add handle keydown trigger
9550a49 is described below

commit 9550a498801bce0bb52e9cab5c961cd490dbd0e3
Author: hughhhh <hmi...@lyft.com>
AuthorDate: Wed Jan 23 19:28:13 2019 -0800

    add handle keydown trigger
---
 superset/assets/src/dashboard/components/Dashboard.jsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx 
b/superset/assets/src/dashboard/components/Dashboard.jsx
index 2e6f5ac..6915c8f 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -96,12 +96,24 @@ class Dashboard extends React.PureComponent {
     });
     Logger.start(this.actionLog);
     this.initTs = new Date().getTime();
+
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
 
   componentDidMount() {
     Logger.append(LOG_ACTIONS_MOUNT_DASHBOARD);
+    document.addEventListener('keydown', this.handleKeydown);
+  }
+
+  componentWillUnmount() {
+    document.removeEventListener('keydown', this.handleKeydown);
   }
 
+  handleKeydown() {
+    console.log('presing some key....')
+  }
+
+
   componentWillReceiveProps(nextProps) {
     if (!nextProps.dashboardState.editMode) {
       // log pane loads

Reply via email to