public/javascripts/yui/slider/slider-debug.js
function(x, y, skipAnim, midMove) {

        var t = this.thumb,
            self = this,
            p,_p,anim;

        if (!t.available) {
            this.logger.log("thumb is not available yet, aborting move");
            return;
        }

        this.logger.log("move thumb, x: "  + x + ", y: " + y);

        t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);

        _p = t.getTargetCoord(x, y);
        p = [Math.round(_p.x), Math.round(_p.y)];

        if (this.animate && t._graduated && !skipAnim) {
            this.logger.log("graduated");
            this.lock();

            // cache the current thumb pos
            this.curCoord = getXY(this.thumb.getEl());
            this.curCoord = [Math.round(this.curCoord[0]), Math.round(this.curCoord[1])];

            setTimeout( function() { self.moveOneTick(p); }, this.tickPause );

        } else if (this.animate && Slider.ANIM_AVAIL && !skipAnim) {
            this.logger.log("animating to " + p);

            this.lock();

            anim = new YAHOO.util.Motion( 
                    t.id, { points: { to: p } }, 
                    this.animationDuration, 
                    YAHOO.util.Easing.easeOut );

            anim.onComplete.subscribe( function() { 
                    self.logger.log("Animation completed _mouseDown:" + self._mouseDown);
                    self.unlock();
                    if (!self._mouseDown) {
                        self.endMove(); 
                    }
                });
            anim.animate();

        } else {
            t.setDragElPos(x, y);
            if (!midMove && !this._mouseDown) {
                this.endMove();
            }
        }
    }
function(x, y, skipAnim, midMove) {

        var t = this.thumb,
            self = this,
            p,_p,anim;

        if (!t.available) {
            this.logger.log("thumb is not available yet, aborting move");
            return;
        }

        this.logger.log("move thumb, x: "  + x + ", y: " + y);

        t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);

        _p = t.getTargetCoord(x, y);
        p = [Math.round(_p.x), Math.round(_p.y)];

        if (this.animate && t._graduated && !skipAnim) {
            this.logger.log("graduated");
            this.lock();

            // cache the current thumb pos
            this.curCoord = getXY(this.thumb.getEl());
            this.curCoord = [Math.round(this.curCoord[0]), Math.round(this.curCoord[1])];

            setTimeout( function() { self.moveOneTick(p); }, this.tickPause );

        } else if (this.animate && Slider.ANIM_AVAIL && !skipAnim) {
            this.logger.log("animating to " + p);

            this.lock();

            anim = new YAHOO.util.Motion( 
                    t.id, { points: { to: p } }, 
                    this.animationDuration, 
                    YAHOO.util.Easing.easeOut );

            anim.onComplete.subscribe( function() { 
                    self.logger.log("Animation completed _mouseDown:" + self._mouseDown);
                    self.unlock();
                    if (!self._mouseDown) {
                        self.endMove(); 
                    }
                });
            anim.animate();

        } else {
            t.setDragElPos(x, y);
            if (!midMove && !this._mouseDown) {
                this.endMove();
            }
        }
    }
function ( x , y , skipAnim , midMove ) { var t = this . thumb , self = this , p , _p , anim ; if ( ! t . available ) { this . logger . log ( "thumb is not available yet, aborting move" ) ; return ; } this . logger . log ( "move thumb, x: " + x + ", y: " + y ) ; t . setDelta ( this . thumbCenterPoint . x , this . thumbCenterPoint . y ) ; _p = t . getTargetCoord ( x , y ) ; p = [ Math . round ( _p . x ) , Math . round ( _p . y ) ] ; if ( this . animate && t . _graduated && ! skipAnim ) { this . logger . log ( "graduated" ) ; this . lock ( ) ; // cache the current thumb pos this . curCoord = getXY ( this . thumb . getEl ( ) ) ; this . curCoord = [ Math . round ( this . curCoord [ 0 ] ) , Math . round ( this . curCoord [ 1 ] ) ] ; setTimeout ( function ( ) { self . moveOneTick ( p ) ; } , this . tickPause ) ; } else if ( this . animate && Slider . ANIM_AVAIL && ! skipAnim ) { this . logger . log ( "animating to " + p ) ; this . lock ( ) ; anim = new YAHOO . util . Motion ( t . id , { points : { to : p } } , this . animationDuration , YAHOO . util . Easing . easeOut ) ; anim . onComplete . subscribe ( function ( ) { self . logger . log ( "Animation completed _mouseDown:" + self . _mouseDown ) ; self . unlock ( ) ; if ( ! self . _mouseDown ) { self . endMove ( ) ; } } ) ; anim . animate ( ) ; } else { t . setDragElPos ( x , y ) ; if ( ! midMove && ! this . _mouseDown ) { this . endMove ( ) ; } } }
Move the associated slider moved to a timeout to try to get around the
mousedown stealing moz does when I move the slider element between the
cursor and the background during the mouseup event
@method moveThumb
@param {int} x the X coordinate of the click
@param {int} y the Y coordinate of the click
@param {boolean} skipAnim don't animate if the move happend onDrag
@param {boolean} midMove set to true if this is not terminating
the slider movement
@private
Move the associated slider moved to a timeout to try to get around the mousedown stealing moz does when I move the slider element between the cursor and the background during the mouseup event