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 */
22
33/**
44 * Unobtrusive scripting adapter for jQuery
1010 *
1111 */
1212
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 ( ) {
1514 'use strict' ;
1615
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.
1720 if ( $ . rails !== undefined ) {
1821 $ . error ( 'jquery-ujs has already been loaded!' ) ;
1922 }
552555 } ) ;
553556 }
554557
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