]> source.dussan.org Git - jquery.git/commitdiff
Effects: Remove additional parameters of easings
authorThomas Tortorini <thomastortorini@gmail.com>
Sat, 27 Jun 2015 15:18:21 +0000 (17:18 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 7 Sep 2015 20:07:32 +0000 (22:07 +0200)
Fixes gh-2367
Closes gh-2376

src/effects/Tween.js
test/unit/tween.js

index d26ddd918957884a4e2e7fb2abbb9d8542fffb39..47f15a9479db0dc68c8539e1c51870b1a1860b8a 100644 (file)
@@ -27,17 +27,12 @@ Tween.prototype = {
                        Tween.propHooks._default.get( this );
        },
        run: function( percent ) {
-               var eased,
-                       hooks = Tween.propHooks[ this.prop ];
+               var hooks = Tween.propHooks[ this.prop ];
 
-               if ( this.options.duration ) {
-                       this.pos = eased = jQuery.easing[ this.easing ](
-                               percent, this.options.duration * percent, 0, 1, this.options.duration
-                       );
-               } else {
-                       this.pos = eased = percent;
-               }
-               this.now = ( this.end - this.start ) * eased + this.start;
+               this.pos = this.options.duration ?
+                       jQuery.easing[ this.easing ]( percent ) :
+                       percent;
+               this.now = ( this.end - this.start ) * this.pos + this.start;
 
                if ( this.options.step ) {
                        this.options.step.call( this.elem, this.now, this );
index 28fcfad257bc8bf8d19e4e9daed5ddcdc3299aec..f66aa37b6aad9c2b505e27ffc6ac473acc5245de 100644 (file)
@@ -160,8 +160,7 @@ QUnit.test( "jQuery.Tween - Plain Object", function( assert ) {
 
        assert.equal( tween.now, 90, "Calculated tween" );
 
-       assert.ok( easingSpy.calledWith( 0.1, 0.1 * testOptions.duration, 0, 1, testOptions.duration ),
-               "...using jQuery.easing.linear with back-compat arguments" );
+       assert.ok( easingSpy.calledWith( 0.1 ), "...using jQuery.easing.linear" );
        assert.equal( testObject.test, 90, "Set value" );
 
        tween.run( 1 );
@@ -200,10 +199,7 @@ QUnit.test( "jQuery.Tween - Element", function( assert ) {
        eased = 100 - ( jQuery.easing.swing( 0.1 ) * 100 );
        assert.equal( tween.now, eased, "Calculated tween" );
 
-       assert.ok(
-               easingSpy.calledWith( 0.1, 0.1 * testOptions.duration, 0, 1, testOptions.duration ),
-               "...using jQuery.easing.linear with back-compat arguments"
-       );
+       assert.ok( easingSpy.calledWith( 0.1 ), "...using jQuery.easing.linear" );
        assert.equal(
                parseFloat( testElement.style.height ).toFixed( 2 ),
                eased.toFixed( 2 ), "Set value"