@@ -117,7 +117,6 @@ var turbolinksClassicEvents = __webpack_require__(10)
117117// see what things are globally available
118118// and setup event handlers to those things
119119module . exports = function ( ujs ) {
120-
121120 if ( ujs . handleEvent ) {
122121 // We're calling this a second time -- remove previous handlers
123122 turbolinksClassicEvents . teardown ( ujs )
@@ -385,13 +384,9 @@ module.exports = {
385384 } ,
386385
387386 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 ) ;
395390 }
396391}
397392
@@ -408,7 +403,7 @@ module.exports = {
408403 ujs . handleEvent ( 'pjax:beforeReplace' , ujs . handleUnmount ) ;
409404 } ,
410405
411- teardown : function ( ) {
406+ teardown : function ( ujs ) {
412407 ujs . removeEvent ( 'ready' , ujs . handleMount ) ;
413408 ujs . removeEvent ( 'pjax:end' , ujs . handleMount ) ;
414409 ujs . removeEvent ( 'pjax:beforeReplace' , ujs . handleUnmount ) ;
0 commit comments