From 5fc87b941f3ad4b200281447b6c0879e894622b7 Mon Sep 17 00:00:00 2001 From: cptran777 Date: Fri, 7 Sep 2018 10:29:14 -0700 Subject: [PATCH] Cleanup hotkey code for query selector --- wherehows-web/app/components/hotkeys/global-hotkeys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wherehows-web/app/components/hotkeys/global-hotkeys.ts b/wherehows-web/app/components/hotkeys/global-hotkeys.ts index 3c61f914ab..48b8f2008b 100644 --- a/wherehows-web/app/components/hotkeys/global-hotkeys.ts +++ b/wherehows-web/app/components/hotkeys/global-hotkeys.ts @@ -65,7 +65,7 @@ export default class GlobalHotkeys extends Component { } didInsertElement() { - const body = document.getElementsByClassName('ember-application')[0]; + const body = document.querySelector('.ember-application'); if (body) { body.addEventListener('keyup', this.onKeyUp.bind(this)); @@ -73,7 +73,7 @@ export default class GlobalHotkeys extends Component { } willDestroyElement() { - const body = document.getElementsByClassName('ember-application')[0]; + const body = document.querySelector('.ember-application'); if (body) { body.removeEventListener('keyup', this.onKeyUp.bind(this));