@ -196,12 +196,12 @@ Range.prototype.setRange = function(start, end, options, callback) {
if ( options . byUser !== true ) {
if ( options . byUser !== true ) {
options . byUser = false ;
options . byUser = false ;
}
}
var me = this ;
var finalStart = start != undefined ? util . convert ( start , 'Date' ) . valueOf ( ) : null ;
var finalStart = start != undefined ? util . convert ( start , 'Date' ) . valueOf ( ) : null ;
var finalEnd = end != undefined ? util . convert ( end , 'Date' ) . valueOf ( ) : null ;
var finalEnd = end != undefined ? util . convert ( end , 'Date' ) . valueOf ( ) : null ;
this . _cancelAnimation ( ) ;
this . _cancelAnimation ( ) ;
if ( options . animation ) { // true or an Object
if ( options . animation ) { // true or an Object
var me = this ;
var initStart = this . start ;
var initStart = this . start ;
var initEnd = this . end ;
var initEnd = this . end ;
var duration = ( typeof options . animation === 'object' && 'duration' in options . animation ) ? options . animation . duration : 500 ;
var duration = ( typeof options . animation === 'object' && 'duration' in options . animation ) ? options . animation . duration : 500 ;
@ -265,8 +265,12 @@ Range.prototype.setRange = function(start, end, options, callback) {
byUser : options . byUser ,
byUser : options . byUser ,
event : options . event
event : options . event
} ;
} ;
this . body . emitter . emit ( 'rangechange' , params ) ;
this . body . emitter . emit ( 'rangechange' , params ) ;
this . body . emitter . emit ( 'rangechanged' , params ) ;
clearTimeout ( me . timeoutID ) ;
me . timeoutID = setTimeout ( function ( ) {
me . body . emitter . emit ( 'rangechanged' , params ) ;
} , 200 ) ;
if ( callback ) { return callback ( ) }
if ( callback ) { return callback ( ) }
}
}
}
}