Add function reference for chapter keyboard navigation

This commit is contained in:
Tetrakern 2024-05-11 15:34:14 +02:00
parent 2e6ecfa872
commit c604705afe
3 changed files with 8 additions and 5 deletions

2
js/chapter.min.js vendored

File diff suppressed because one or more lines are too long

4
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1261,7 +1261,8 @@ _$$('.chapter-list-popup-toggle').forEach(element => {
// KEYBOARD NAVIGATION
// =============================================================================
document.addEventListener('keydown', event => {
// Keep removable reference
const fcn_chapterKeyboardNavigation = event => {
const editableTags = ['INPUT', 'TEXTAREA', 'SELECT', 'OPTION'];
// Abort if inside input...
@ -1282,7 +1283,9 @@ document.addEventListener('keydown', event => {
if (link && link.href) {
window.location.href = link + '#start';
}
});
}
document.addEventListener('keydown', fcn_chapterKeyboardNavigation);
// =============================================================================
// SCROLL TO START OG CHAPTER