File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -239,16 +239,7 @@ $.widget( "ui.spinner", {
239239 this . counter = 1 ;
240240 }
241241
242- // TODO refactor, maybe figure out some non-linear math
243- // x*x*x/50000 - x*x/500 + 17*x/200 + 1
244- var newVal = this . value ( ) + step * ( this . options . incremental &&
245- this . counter > 20
246- ? this . counter > 100
247- ? this . counter > 200
248- ? 100
249- : 10
250- : 2
251- : 1 ) ;
242+ var newVal = this . value ( ) + step * this . _increment ( this . counter ) ;
252243
253244 // clamp the new value
254245 newVal = this . _trimValue ( newVal ) ;
@@ -259,6 +250,12 @@ $.widget( "ui.spinner", {
259250 }
260251 } ,
261252
253+ _increment : function ( i ) {
254+ return this . options . incremental ?
255+ Math . floor ( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ) :
256+ 1 ;
257+ } ,
258+
262259 _trimValue : function ( value ) {
263260 var options = this . options ;
264261
You can’t perform that action at this time.
0 commit comments