mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 09:44:56 -05:00
Effects: Remove additional parameters of easings
(cherry-picked from b7a7dea95f)
Fixes gh-2367
Closes gh-2376
This commit is contained in:
committed by
Michał Gołębiowski
parent
cbb0be6c41
commit
41a04e59df
@@ -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 );
|
||||
|
||||
@@ -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"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user