@@ -17,8 +17,7 @@ function modifier( fn ) {
17
17
return function ( ) {
18
18
var previous = this . options . value ;
19
19
fn . apply ( this , arguments ) ;
20
- this . _format ( ) ;
21
- this . _aria ( ) ;
20
+ this . _refresh ( ) ;
22
21
if ( previous !== this . options . value ) {
23
22
this . _trigger ( "change" ) ;
24
23
}
@@ -48,7 +47,7 @@ $.widget( "ui.spinner", {
48
47
this . _value ( this . options . value ) ;
49
48
this . _draw ( ) ;
50
49
this . _mousewheel ( ) ;
51
- this . _aria ( ) ;
50
+ this . _refresh ( ) ;
52
51
} ,
53
52
54
53
_getCreateOptions : function ( ) {
@@ -307,14 +306,6 @@ $.widget( "ui.spinner", {
307
306
this . _value ( this . _trimValue ( this . options . value ) ) ;
308
307
} ) ,
309
308
310
- _aria : function ( ) {
311
- this . element . attr ( {
312
- "aria-valuemin" : this . options . min ,
313
- "aria-valuemax" : this . options . max ,
314
- "aria-valuenow" : this . options . value
315
- } ) ;
316
- } ,
317
-
318
309
_parse : function ( val ) {
319
310
if ( typeof val === "string" ) {
320
311
val = $ . global && this . options . numberFormat ? $ . global . parseFloat ( val ) : + val ;
@@ -324,14 +315,23 @@ $.widget( "ui.spinner", {
324
315
325
316
_format : function ( ) {
326
317
var num = this . options . value ;
327
- this . element . val ( $ . global && this . options . numberFormat ? $ . global . format ( num , this . options . numberFormat ) : num ) ;
318
+ return $ . global && this . options . numberFormat ? $ . global . format ( num , this . options . numberFormat ) : num ;
319
+ } ,
320
+
321
+ _refresh : function ( ) {
322
+ this . element
323
+ . val ( this . _format ( ) )
324
+ . attr ( {
325
+ "aria-valuemin" : this . options . min ,
326
+ "aria-valuemax" : this . options . max ,
327
+ "aria-valuenow" : this . options . value
328
+ } ) ;
328
329
} ,
329
330
330
331
// update the value without triggering change
331
332
_value : function ( value ) {
332
333
this . options . value = this . _trimValue ( this . _parse ( value ) ) ;
333
- this . _format ( ) ;
334
- this . _aria ( ) ;
334
+ this . _refresh ( ) ;
335
335
} ,
336
336
337
337
destroy : function ( ) {
@@ -371,7 +371,7 @@ $.widget( "ui.spinner", {
371
371
372
372
value : function ( newVal ) {
373
373
if ( ! arguments . length ) {
374
- return this . _parse ( this . element . val ( ) ) ;
374
+ return this . _format ( ) ;
375
375
}
376
376
this . option ( "value" , newVal ) ;
377
377
} ,
0 commit comments