Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6c2c736

Browse files
authored
Effects: Remove jQuery.fx.interval
`jQuery.fx.interval` has been deprecated since jQuery 3.0.0 but it has beenstill used in jQuery code until this change. This commit removes the definitionand explicitly uses the `13` number in its place.Closesgh-5017
1 parentaf1cd6f commit6c2c736

File tree

4 files changed

+155
-181
lines changed

4 files changed

+155
-181
lines changed

‎src/effects.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function schedule() {
2727
if(document.hidden===false&&window.requestAnimationFrame){
2828
window.requestAnimationFrame(schedule);
2929
}else{
30-
window.setTimeout(schedule,jQuery.fx.interval);
30+
window.setTimeout(schedule,13);
3131
}
3232

3333
jQuery.fx.tick();
@@ -663,7 +663,6 @@ jQuery.fx.timer = function( timer ) {
663663
jQuery.fx.start();
664664
};
665665

666-
jQuery.fx.interval=13;
667666
jQuery.fx.start=function(){
668667
if(inProgress){
669668
return;

‎test/unit/animation.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ if ( !jQuery.fx ) {
55
return;
66
}
77

8-
varoldRaf=window.requestAnimationFrame,
8+
varfxInterval=13,
9+
oldRaf=window.requestAnimationFrame,
910
defaultPrefilter=jQuery.Animation.prefilters[0],
1011
defaultTweener=jQuery.Animation.tweeners["*"][0],
1112
startTime=505877050;
@@ -15,17 +16,14 @@ QUnit.module( "animation", {
1516
beforeEach:function(){
1617
this.sandbox=sinon.createSandbox();
1718
this.clock=this.sandbox.useFakeTimers(startTime);
18-
this._oldInterval=jQuery.fx.interval;
1919
window.requestAnimationFrame=null;
2020
jQuery.fx.step={};
21-
jQuery.fx.interval=10;
2221
jQuery.Animation.prefilters=[defaultPrefilter];
2322
jQuery.Animation.tweeners={"*":[defaultTweener]};
2423
},
2524
afterEach:function(){
2625
this.sandbox.restore();
2726
jQuery.fx.stop();
28-
jQuery.fx.interval=this._oldInterval;
2927
window.requestAnimationFrame=oldRaf;
3028
returnmoduleTeardown.apply(this,arguments);
3129
}
@@ -36,7 +34,7 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
3634

3735
varsubject={test:0},
3836
props={test:1},
39-
opts={queue:"fx",duration:100},
37+
opts={queue:"fx",duration:fxInterval*10},
4038
animation=jQuery.Animation(subject,props,opts);
4139

4240
assert.equal(
@@ -59,14 +57,14 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
5957
assert.deepEqual(animation.props,props,".props is a copy of the original");
6058

6159
assert.deepEqual(animation.opts,{
62-
duration:100,
60+
duration:fxInterval*10,
6361
queue:"fx",
6462
specialEasing:{test:undefined},
6563
easing:jQuery.easing._default
6664
},".options is filled with default easing and specialEasing");
6765

6866
assert.equal(animation.startTime,startTime,"startTime was set");
69-
assert.equal(animation.duration,100,".duration is set");
67+
assert.equal(animation.duration,fxInterval*10,".duration is set");
7068

7169
assert.equal(animation.tweens.length,1,".tweens has one Tween");
7270
assert.equal(typeofanimation.tweens[0].run,"function","which has a .run function");
@@ -85,7 +83,7 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
8583
assert.equal(jQuery.timers[0].queue,opts.queue,"...with .queue");
8684

8785
// Cleanup after ourselves by ticking to the end
88-
this.clock.tick(100);
86+
this.clock.tick(fxInterval*10);
8987
});
9088

9189
QUnit.test("Animation.prefilter( fn ) - calls prefilter after defaultPrefilter",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp