Skip to content

Commit 0abd13c

Browse files
author
Kevin Pheasey
committed
Use Turbolinks 5 events for clearing event handlers.
1 parent 54bee20 commit 0abd13c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/generators/rails_script/install/templates/base.js.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class <%= RailsScript.app_namespace %>.Base
3737
loads, i.e. "$(window).on 'scroll.app', myHandler"
3838
###
3939
setClearEventHandlers: ->
40-
jQuery(document).on 'page:before-change', ->
40+
jQuery(document).on 'turbolinks:before-visit', ->
4141
for element in [window, document]
4242
for event, handlers of (jQuery._data(element, 'events') || {})
4343
for handler in handlers

0 commit comments

Comments
 (0)