/
githubmirror
/
fullPage.js
Обзор
Документация
Войти
/
githubmirror
/
fullPage.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/js/fitToSection.js
29 строк
893 B
Alvaro Trigo López
- Fixed bug: Clear fitToSectionDelay when declaring setFitToSection(false) #4590
23 июл 2024, 21:38
23 июл 2024, 21:38
386f92f
Код
Авторство
О чём код?
import { getOptions, setVariableState } from './common/options.js'; import { FP } from './common/constants.js'; import { setState, state } from './common/state.js'; import { scrollPage } from './scroll/scrollPage.js'; FP.setFitToSection = setFitToSection; FP.fitToSection = fitToSection; /** * Sets fitToSection */ export function setFitToSection(value, type){ setVariableState('fitToSection', value, type); } /** * Fits the site to the nearest active section */ export function fitToSection(){ //checking fitToSection again in case it was set to false before the timeout delay if(state.canScroll && getOptions().fitToSection){ //allows to scroll to an active section and //if the section is already active, we prevent firing callbacks setState({isResizing: true}); scrollPage(state.activeSection); setState({isResizing: false}); } }