File tree Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 4
4
* https://github.com/marcj/css-element-queries/blob/master/LICENSE.
5
5
*/
6
6
;
7
- ( function ( ) {
8
-
9
- var ResizeSensor = window . ResizeSensor ;
10
-
11
- if ( typeof module !== 'undefined' && typeof module . exports !== 'undefined' ) {
12
- ResizeSensor = require ( './ResizeSensor' ) ;
7
+ ( function ( root , factory ) {
8
+ if ( typeof define === "function" && define . amd ) {
9
+ define ( [ './ResizeSensor.js' ] , factory ) ;
10
+ } else if ( typeof exports === "object" ) {
11
+ module . exports = factory ( require ( './ResizeSensor.js' ) ) ;
12
+ } else {
13
+ root . ElementQueries = factory ( root . ResizeSensor ) ;
13
14
}
15
+ } ( this , function ( ResizeSensor ) {
14
16
15
17
/**
16
18
*
507
509
window . ElementQueries = ElementQueries ;
508
510
ElementQueries . listen ( ) ;
509
511
}
510
- } ) ( ) ;
512
+
513
+ return ElementQueries ;
514
+
515
+ } ) ) ;
Original file line number Diff line number Diff line change 4
4
* https://github.com/marcj/css-element-queries/blob/master/LICENSE.
5
5
*/
6
6
;
7
- ( function ( ) {
7
+ ( function ( root , factory ) {
8
+ if ( typeof define === "function" && define . amd ) {
9
+ define ( factory ) ;
10
+ } else if ( typeof exports === "object" ) {
11
+ module . exports = factory ( ) ;
12
+ } else {
13
+ root . ResizeSensor = factory ( ) ;
14
+ }
15
+ } ( this , function ( ) {
8
16
9
17
// Only used for the dirty checking, so the event callback count is limted to max 1 call per fps per sensor.
10
18
// In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
205
213
} ) ;
206
214
} ;
207
215
208
- // make available to common module loader
209
- if ( typeof module !== 'undefined' && typeof module . exports !== 'undefined' ) {
210
- module . exports = ResizeSensor ;
211
- }
212
- else {
213
- window . ResizeSensor = ResizeSensor ;
214
- }
216
+ return ResizeSensor ;
215
217
216
- } ) ( ) ;
218
+ } ) ) ;
You can’t perform that action at this time.
0 commit comments