1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-09 07:25:21 +02:00

event listner using shortcut added

This commit is contained in:
Umang G. Patel 2022-08-28 23:38:10 +05:30
parent ba9e854086
commit 8b90e95270

View file

@ -112,8 +112,6 @@ export default class Sidebar {
}); });
// Get search results if search input is empty. // Get search results if search input is empty.
this.search(''); this.search('');
// Add event listener for keyboard events.
document.addEventListener('keydown', e => this.keyboardListener(e));
this.ready(); this.ready();
} }
@ -241,6 +239,13 @@ export default class Sidebar {
on: document.body, on: document.body,
callback: () => this.handleSliderClick(), callback: () => this.handleSliderClick(),
}); });
// eslint-disable-next-line no-new
new Shortcut({
name: 'CMD+P',
on: document.body,
callback: () => {this.nodes.search.focus()},
});
} }
/** /**