superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [incubator-superset] branch omnibar updated: add handle keydown trigger
Date Thu, 24 Jan 2019 03:28:28 GMT
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 <hmiles@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


Mime
View raw message