File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 535
535
FP . moveTo = moveTo ;
536
536
FP . moveSlideRight = moveSlideRight ;
537
537
FP . moveSlideLeft = moveSlideLeft ;
538
+ FP . fitToSection = fitToSection ;
538
539
FP . reBuild = reBuild ;
539
540
FP . setResponsive = setResponsive ;
540
541
FP . destroy = destroy ;
1018
1019
clearTimeout ( scrollId2 ) ;
1019
1020
1020
1021
scrollId2 = setTimeout ( function ( ) {
1021
- //checking fitToSection again in case it was set to false before the timeout delay
1022
- if ( canScroll && options . fitToSection ) {
1023
- //allows to scroll to an active section and
1024
- //if the section is already active, we prevent firing callbacks
1025
- if ( $ ( SECTION_ACTIVE_SEL ) . is ( currentSection ) ) {
1026
- isResizing = true ;
1027
- }
1028
- scrollPage ( $ ( SECTION_ACTIVE_SEL ) ) ;
1029
-
1030
- isResizing = false ;
1022
+ //checking it again in case it changed during the delay
1023
+ if ( options . fitToSection ) {
1024
+ fitToSection ( ) ;
1031
1025
}
1032
1026
} , options . fitToSectionDelay ) ;
1033
1027
}
1034
1028
}
1035
1029
}
1036
1030
1031
+ function fitToSection ( ) {
1032
+ //checking fitToSection again in case it was set to false before the timeout delay
1033
+ if ( canScroll ) {
1034
+ //allows to scroll to an active section and
1035
+ //if the section is already active, we prevent firing callbacks
1036
+ isResizing = true ;
1037
+
1038
+ scrollPage ( $ ( SECTION_ACTIVE_SEL ) ) ;
1039
+ isResizing = false ;
1040
+ }
1041
+ }
1042
+
1037
1043
/**
1038
1044
* Determines whether the active section has seen in its whole or not.
1039
1045
*/
You can’t perform that action at this time.
0 commit comments