Skip to content

Commit b7a7dea

Browse files
mr21mgol
authored andcommitted
Effects: Remove additional parameters of easings
Fixes gh-2367 Closes gh-2376
1 parent c9cf250 commit b7a7dea

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/effects/Tween.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,12 @@ Tween.prototype = {
2727
Tween.propHooks._default.get( this );
2828
},
2929
run: function( percent ) {
30-
var eased,
31-
hooks = Tween.propHooks[ this.prop ];
30+
var hooks = Tween.propHooks[ this.prop ];
3231

33-
if ( this.options.duration ) {
34-
this.pos = eased = jQuery.easing[ this.easing ](
35-
percent, this.options.duration * percent, 0, 1, this.options.duration
36-
);
37-
} else {
38-
this.pos = eased = percent;
39-
}
40-
this.now = ( this.end - this.start ) * eased + this.start;
32+
this.pos = this.options.duration ?
33+
jQuery.easing[ this.easing ]( percent ) :
34+
percent;
35+
this.now = ( this.end - this.start ) * this.pos + this.start;
4136

4237
if ( this.options.step ) {
4338
this.options.step.call( this.elem, this.now, this );

test/unit/tween.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ QUnit.test( "jQuery.Tween - Plain Object", function( assert ) {
160160

161161
assert.equal( tween.now, 90, "Calculated tween" );
162162

163-
assert.ok( easingSpy.calledWith( 0.1, 0.1 * testOptions.duration, 0, 1, testOptions.duration ),
164-
"...using jQuery.easing.linear with back-compat arguments" );
163+
assert.ok( easingSpy.calledWith( 0.1 ), "...using jQuery.easing.linear" );
165164
assert.equal( testObject.test, 90, "Set value" );
166165

167166
tween.run( 1 );
@@ -200,10 +199,7 @@ QUnit.test( "jQuery.Tween - Element", function( assert ) {
200199
eased = 100 - ( jQuery.easing.swing( 0.1 ) * 100 );
201200
assert.equal( tween.now, eased, "Calculated tween" );
202201

203-
assert.ok(
204-
easingSpy.calledWith( 0.1, 0.1 * testOptions.duration, 0, 1, testOptions.duration ),
205-
"...using jQuery.easing.linear with back-compat arguments"
206-
);
202+
assert.ok( easingSpy.calledWith( 0.1 ), "...using jQuery.easing.linear" );
207203
assert.equal(
208204
parseFloat( testElement.style.height ).toFixed( 2 ),
209205
eased.toFixed( 2 ), "Set value"

0 commit comments

Comments
 (0)