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:
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.
|
// 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()},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue