mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-09 07:25:21 +02:00
feat:integrate sidebar toggle with search shortcut
This commit is contained in:
parent
6c4769c297
commit
ab96ea0738
1 changed files with 5 additions and 0 deletions
|
@ -252,6 +252,11 @@ export default class Sidebar {
|
||||||
name: 'CMD+P',
|
name: 'CMD+P',
|
||||||
on: document.body,
|
on: document.body,
|
||||||
callback: (e) => {
|
callback: (e) => {
|
||||||
|
// If sidebar is not visible.
|
||||||
|
if (!this.isVisible) {
|
||||||
|
// make sidebar visible.
|
||||||
|
this.handleSliderClick();
|
||||||
|
}
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
this.nodes.search.focus();
|
this.nodes.search.focus();
|
||||||
// Stop propagation of event.
|
// Stop propagation of event.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue