File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 916
916
$ . isFunction ( options . afterRender ) && options . afterRender . call ( container ) ;
917
917
}
918
918
919
+ /**
920
+ * Determines if the URL anchor destiny is the starting section (the one using 'active' class before initialization)
921
+ */
919
922
function isDestinyTheStartingSection ( ) {
920
923
var anchors = window . location . hash . replace ( '#' , '' ) . split ( '/' ) ;
921
924
var destinationSection = getSectionByAnchor ( decodeURIComponent ( anchors [ 0 ] ) ) ;
1028
1031
}
1029
1032
}
1030
1033
1034
+ /**
1035
+ * Fits the site to the nearest active section
1036
+ */
1031
1037
function fitToSection ( ) {
1032
1038
//checking fitToSection again in case it was set to false before the timeout delay
1033
1039
if ( canScroll ) {
1034
1040
//allows to scroll to an active section and
1035
1041
//if the section is already active, we prevent firing callbacks
1036
1042
isResizing = true ;
1037
-
1043
+
1038
1044
scrollPage ( $ ( SECTION_ACTIVE_SEL ) ) ;
1039
1045
isResizing = false ;
1040
1046
}
2290
2296
function getSectionByAnchor ( sectionAnchor ) {
2291
2297
if ( ! sectionAnchor ) return [ ] ;
2292
2298
2293
- //section
2294
2299
var section = container . find ( SECTION_SEL + '[data-anchor="' + sectionAnchor + '"]' ) ;
2295
2300
if ( ! section . length ) {
2296
2301
section = $ ( SECTION_SEL ) . eq ( sectionAnchor - 1 ) ;
You can’t perform that action at this time.
0 commit comments