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:
parent
ba9e854086
commit
8b90e95270
1 changed files with 21 additions and 16 deletions
|
@ -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()},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue