summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-04-13 12:01:45 -0700
committerYabin Cui <yabinc@google.com>2018-04-13 12:08:04 -0700
commit5abc6babadc90b94c792420244de6a2d2081a91e (patch)
treec98e71d5fdb1d9c58657f2f6d60702c214443cc6
parent0c3afce549e3d696fa7f1213457754f1cb54c528 (diff)
downloadextras-5abc6babadc90b94c792420244de6a2d2081a91e.tar.gz
inferno: fix key input when embedding inferno in report_html.py.
It avoids the keydown handler in inferno blocking other key event handlers. Bug: none Test: run inferno and report_html.py manually. Change-Id: I0ef013c6a205a5dce689b5ec8413786b1a1b7714
-rw-r--r--simpleperf/scripts/inferno/script.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/simpleperf/scripts/inferno/script.js b/simpleperf/scripts/inferno/script.js
index 7a7bb8f9..e8a998d3 100644
--- a/simpleperf/scripts/inferno/script.js
+++ b/simpleperf/scripts/inferno/script.js
@@ -204,9 +204,9 @@ function search(e) {
}
let selected;
-document.onkeydown = function handle_keyboard_input(e) {
+document.addEventListener('keydown', (e) => {
if (!selected) {
- return;
+ return false;
}
let nav = selected.attributes['nav'].value.split(',');
@@ -238,7 +238,7 @@ document.onkeydown = function handle_keyboard_input(e) {
let target_element = selected.ownerSVGElement.getElementById(nav[navigation_index]);
select(target_element);
return false;
-};
+});
function select(e) {
if (selected) {