1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-08 15:05:26 +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.
this.search('');
// Add event listener for keyboard events.
document.addEventListener('keydown', e => this.keyboardListener(e));
this.ready();
}
@ -241,6 +239,13 @@ export default class Sidebar {
on: document.body,
callback: () => this.handleSliderClick(),
});
// eslint-disable-next-line no-new
new Shortcut({
name: 'CMD+P',
on: document.body,
callback: () => {this.nodes.search.focus()},
});
}
/**