File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
- ( function ( $ , undefined ) {
1
+ /* jshint node: true */
2
2
3
3
/**
4
4
* Unobtrusive scripting adapter for jQuery
10
10
*
11
11
*/
12
12
13
- // Cut down on the number of issues from people inadvertently including jquery_ujs twice
14
- // by detecting and raising an error when it happens.
13
+ ( function ( ) {
15
14
'use strict' ;
16
15
16
+ var jqueryUjsInit = function ( $ , undefined ) {
17
+
18
+ // Cut down on the number of issues from people inadvertently including jquery_ujs twice
19
+ // by detecting and raising an error when it happens.
17
20
if ( $ . rails !== undefined ) {
18
21
$ . error ( 'jquery-ujs has already been loaded!' ) ;
19
22
}
552
555
} ) ;
553
556
}
554
557
555
- } ) ( jQuery ) ;
558
+ } ;
559
+
560
+ if ( window . jQuery ) {
561
+ jqueryUjsInit ( jQuery ) ;
562
+ } else if ( typeof exports === 'object' && typeof module === 'object' ) {
563
+ module . exports = jqueryUjsInit ;
564
+ }
565
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments