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 44 * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
55 */
66;
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 ) ;
1314 }
15+ } ( this , function ( ResizeSensor ) {
1416
1517 /**
1618 *
507509 window . ElementQueries = ElementQueries ;
508510 ElementQueries . listen ( ) ;
509511 }
510- } ) ( ) ;
512+
513+ return ElementQueries ;
514+
515+ } ) ) ;
Original file line number Diff line number Diff line change 44 * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
55 */
66;
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 ( ) {
816
917 // Only used for the dirty checking, so the event callback count is limted to max 1 call per fps per sensor.
1018 // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
205213 } ) ;
206214 } ;
207215
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 ;
215217
216- } ) ( ) ;
218+ } ) ) ;
You can’t perform that action at this time.
0 commit comments