@@ -128,14 +128,7 @@ module.exports = function(ujs) {
128128 nativeEvents . teardown ( ujs ) ;
129129 }
130130
131- if ( ujs . jQuery ) {
132- ujs . handleEvent = function ( eventName , callback ) {
133- ujs . jQuery ( document ) . on ( eventName , callback ) ;
134- } ;
135- ujs . removeEvent = function ( eventName , callback ) {
136- ujs . jQuery ( document ) . off ( eventName , callback ) ;
137- }
138- } else if ( 'addEventListener' in window ) {
131+ if ( 'addEventListener' in window ) {
139132 ujs . handleEvent = function ( eventName , callback ) {
140133 document . addEventListener ( eventName , callback ) ;
141134 } ;
@@ -387,10 +380,7 @@ module.exports = {
387380 // Attach handlers to browser events to mount
388381 // (There are no unmount handlers since the page is destroyed on navigation)
389382 setup : function ( ujs ) {
390- if ( ujs . jQuery ) {
391- // Use jQuery if it's present:
392- ujs . handleEvent ( "ready" , ujs . handleMount ) ;
393- } else if ( 'addEventListener' in window ) {
383+ if ( 'addEventListener' in window ) {
394384 ujs . handleEvent ( 'DOMContentLoaded' , ujs . handleMount ) ;
395385 } else {
396386 // add support to IE8 without jQuery
@@ -399,7 +389,6 @@ module.exports = {
399389 } ,
400390
401391 teardown : function ( ujs ) {
402- ujs . removeEvent ( "ready" , ujs . handleMount ) ;
403392 ujs . removeEvent ( 'DOMContentLoaded' , ujs . handleMount ) ;
404393 ujs . removeEvent ( 'onload' , ujs . handleMount ) ;
405394 }
0 commit comments