forked from jquery/jquery-migrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheffects.js
31 lines (26 loc) · 819 Bytes
/
effects.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { migrateWarn } from "../main.js";
import "../disablePatches.js";
// Support jQuery slim which excludes the effects module
if ( jQuery.fx ) {
var intervalValue = jQuery.fx.interval,
intervalMsg = "jQuery.fx.interval is removed";
// Don't warn if document is hidden, jQuery uses setTimeout (gh-292)
Object.defineProperty( jQuery.fx, "interval", {
configurable: true,
enumerable: true,
get: function() {
if ( !window.document.hidden ) {
migrateWarn( "fx-interval", intervalMsg );
}
// Only fallback to the default if patch is enabled
if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) {
return intervalValue;
}
return intervalValue === undefined ? 13 : intervalValue;
},
set: function( newValue ) {
migrateWarn( "fx-interval", intervalMsg );
intervalValue = newValue;
}
} );
}