@@ -117,7 +117,6 @@ var turbolinksClassicEvents = __webpack_require__(10)
117
117
// see what things are globally available
118
118
// and setup event handlers to those things
119
119
module . exports = function ( ujs ) {
120
-
121
120
if ( ujs . handleEvent ) {
122
121
// We're calling this a second time -- remove previous handlers
123
122
turbolinksClassicEvents . teardown ( ujs )
@@ -385,13 +384,9 @@ module.exports = {
385
384
} ,
386
385
387
386
teardown : function ( ujs ) {
388
- if ( ujs . jQuery ) {
389
- ujs . removeEvent ( "ready" , ujs . handleMount ) ;
390
- } else if ( 'addEventListener' in window ) {
391
- ujs . removeEvent ( 'DOMContentLoaded' , ujs . handleMount ) ;
392
- } else {
393
- ujs . removeEvent ( 'onload' , ujs . handleMount ) ;
394
- }
387
+ ujs . removeEvent ( "ready" , ujs . handleMount ) ;
388
+ ujs . removeEvent ( 'DOMContentLoaded' , ujs . handleMount ) ;
389
+ ujs . removeEvent ( 'onload' , ujs . handleMount ) ;
395
390
}
396
391
}
397
392
@@ -408,7 +403,7 @@ module.exports = {
408
403
ujs . handleEvent ( 'pjax:beforeReplace' , ujs . handleUnmount ) ;
409
404
} ,
410
405
411
- teardown : function ( ) {
406
+ teardown : function ( ujs ) {
412
407
ujs . removeEvent ( 'ready' , ujs . handleMount ) ;
413
408
ujs . removeEvent ( 'pjax:end' , ujs . handleMount ) ;
414
409
ujs . removeEvent ( 'pjax:beforeReplace' , ujs . handleUnmount ) ;
0 commit comments