mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-01 21:33:11 +00:00
Cleanup hotkey code for query selector
This commit is contained in:
parent
36c1a08e12
commit
5fc87b941f
@ -65,7 +65,7 @@ export default class GlobalHotkeys extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
const body = document.getElementsByClassName('ember-application')[0];
|
const body = document.querySelector('.ember-application');
|
||||||
|
|
||||||
if (body) {
|
if (body) {
|
||||||
body.addEventListener('keyup', this.onKeyUp.bind(this));
|
body.addEventListener('keyup', this.onKeyUp.bind(this));
|
||||||
@ -73,7 +73,7 @@ export default class GlobalHotkeys extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
const body = document.getElementsByClassName('ember-application')[0];
|
const body = document.querySelector('.ember-application');
|
||||||
|
|
||||||
if (body) {
|
if (body) {
|
||||||
body.removeEventListener('keyup', this.onKeyUp.bind(this));
|
body.removeEventListener('keyup', this.onKeyUp.bind(this));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user