11/* =============================================================
22
3- Smooth Scroll v4.0
3+ Smooth Scroll v4.1
44 Animate scrolling to anchor links, by Chris Ferdinandi.
55 http://gomakethings.com
66
@@ -17,16 +17,13 @@ window.smoothScroll = (function (window, document, undefined) {
1717 'use strict' ;
1818
1919 // Default settings
20- // Private method
21- // Returns an {object}
22- var _defaults = function ( ) {
23- return {
24- speed : 500 ,
25- easing : 'easeInOutCubic' ,
26- updateURL : false ,
27- callbackBefore : function ( ) { } ,
28- callbackAfter : function ( ) { }
29- } ;
20+ // Private {object} variable
21+ var _defaults = {
22+ speed : 500 ,
23+ easing : 'easeInOutCubic' ,
24+ updateURL : false ,
25+ callbackBefore : function ( ) { } ,
26+ callbackAfter : function ( ) { }
3027 } ;
3128
3229 // Merge default settings with user options
@@ -117,7 +114,7 @@ window.smoothScroll = (function (window, document, undefined) {
117114 var animateScroll = function ( toggle , anchor , options , event ) {
118115
119116 // Options and overrides
120- options = _mergeObjects ( _defaults ( ) , options || { } ) ; // Merge user options with defaults
117+ options = _mergeObjects ( _defaults , options || { } ) ; // Merge user options with defaults
121118 var overrides = _getDataOptions ( toggle . getAttribute ( 'data-options' ) ) ;
122119 var speed = overrides . speed || options . speed ;
123120 var easing = overrides . easing || options . easing ;
@@ -186,7 +183,7 @@ window.smoothScroll = (function (window, document, undefined) {
186183 if ( 'querySelector' in document && 'addEventListener' in window && Array . prototype . forEach ) {
187184
188185 // Selectors and variables
189- options = _mergeObjects ( _defaults ( ) , options || { } ) ; // Merge user options with defaults
186+ options = _mergeObjects ( _defaults , options || { } ) ; // Merge user options with defaults
190187 var toggles = document . querySelectorAll ( '[data-scroll]' ) ; // Get smooth scroll toggles
191188
192189 // When a toggle is clicked, run the click handler
0 commit comments