/
githubmirror
/
fullPage.js
Обзор
Документация
Войти
/
githubmirror
/
fullPage.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/js/keyboard/setKeyboardScrolling.js
30 строк
954 B
Alvaro Trigo López
- Fixed bug: keyboardScrolling:false didn't work on init #4725
11 дек 2025, 13:50
11 дек 2025, 13:50
1fd0020
Код
Авторство
О чём код?
//@ts-check import { getOptions } from '../common/options'; import { FP } from '../common/constants.js'; import { setIsScrollAllowed } from '../common/isScrollAllowed.js'; import { EventEmitter } from '../common/eventEmitter.js'; import { events } from '../common/events.js'; EventEmitter.on(events.beforeInit, beforeInit); FP.setKeyboardScrolling = setKeyboardScrolling; function beforeInit(){ setKeyboardScrolling(getOptions().keyboardScrolling); } /** * Adds or remove the possibility of scrolling through sections by using the keyboard arrow keys */ export function setKeyboardScrolling(value, directions){ if(typeof directions !== 'undefined'){ directions = directions.replace(/ /g,'').split(','); directions.forEach(function(direction){ setIsScrollAllowed(value, direction, 'k'); }); }else{ setIsScrollAllowed(value, 'all', 'k'); getOptions().keyboardScrolling = value; } }