File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 19
19
if ( typeof window === "undefined" ) {
20
20
return null ;
21
21
}
22
+ // https://github.com/Semantic-Org/Semantic-UI/issues/3855
23
+ // https://github.com/marcj/css-element-queries/issues/257
24
+ var globalWindow = typeof window != 'undefined' && window . Math == Math
25
+ ? window
26
+ : typeof self != 'undefined' && self . Math == Math
27
+ ? self
28
+ : Function ( 'return this' ) ( ) ;
22
29
// Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor.
23
30
// In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
24
31
// would generate too many unnecessary events.
25
- var requestAnimationFrame = window . requestAnimationFrame ||
26
- window . mozRequestAnimationFrame ||
27
- window . webkitRequestAnimationFrame ||
32
+ var requestAnimationFrame = globalWindow . requestAnimationFrame ||
33
+ globalWindow . mozRequestAnimationFrame ||
34
+ globalWindow . webkitRequestAnimationFrame ||
28
35
function ( fn ) {
29
- return window . setTimeout ( fn , 20 ) ;
36
+ return globalWindow . setTimeout ( fn , 20 ) ;
30
37
} ;
31
38
32
39
/**
You can’t perform that action at this time.
0 commit comments