File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,12 @@ define([
17
17
stickyClass : '_sticky'
18
18
} ,
19
19
20
- _optionToNumber : function ( option ) {
20
+ _getOptionValue : function ( option ) {
21
21
var value = this . options [ option ] || 0 ;
22
22
if ( typeof value === 'function' ) {
23
23
value = this . options [ option ] ( ) ;
24
24
}
25
-
26
- var converted = Number ( value ) ;
27
- if ( isNaN ( converted ) ) {
28
- throw Error (
29
- 'sticky: Could not convert supplied option "' +
30
- option + '" to Number from "' + value + '"'
31
- ) ;
32
- }
33
- return converted ;
25
+ return value ;
34
26
} ,
35
27
36
28
/**
@@ -61,13 +53,13 @@ define([
61
53
if ( ! isStatic && this . element . is ( ':visible' ) ) {
62
54
offset = $ ( document ) . scrollTop ( )
63
55
- this . parentOffset
64
- + this . _optionToNumber ( 'spacingTop' ) ;
56
+ + this . _getOptionValue ( 'spacingTop' ) ;
65
57
66
58
offset = Math . max ( 0 , Math . min ( offset , this . maxOffset ) ) ;
67
59
68
60
var stuck = this . element . hasClass ( this . options . stickyClass ) ;
69
61
if ( offset && this . options . offsetTop && ! stuck ) {
70
- var offsetTop = this . _optionToNumber ( 'offsetTop' ) ;
62
+ var offsetTop = this . _getOptionValue ( 'offsetTop' ) ;
71
63
if ( offset < offsetTop ) {
72
64
offset = 0 ;
73
65
}
You can’t perform that action at this time.
0 commit comments