]> 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:15:09 +0000 (22:15 +0200)
(cherry-picked from b7a7dea95f84d6d8e5a8186d4fb09a762baf79bb)

Fixes gh-2367
Closes gh-2376

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

index 33edf10f39af265c1378d7b4ed6a73fdb6b99415..4e85e3c51207c0c0f62201cd517385311b6c6d11 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 42ab03789d10068985e7fe7b9b022277143c3d1c..ddd2e8d4336b49df6875016a3aad9983956be51b 100644 (file)
@@ -217,8 +217,7 @@ QUnit.test( "jQuery.Tween - Plain Object", function( assert ) {
                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"
        );
@@ -281,8 +280,7 @@ QUnit.test( "jQuery.Tween - Element", function( assert ) {
                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(
                Math.floor( parseFloat( testElement.style.height ) ), Math.floor( eased ), "Set value"
        );