1
0
Fork 0
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:
Umang G. Patel 2022-08-30 23:52:55 +05:30
parent 6c4769c297
commit ab96ea0738

View file

@ -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.