Skip to content

Commit 978f4ba

Browse files
author
Kevin Pheasey
committed
Clear event handlers on turbolinks:before-render to ensure event handlers are cleared when re-calling page from cache w/ Turbolinks 5.
1 parent de3ee51 commit 978f4ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rails_script/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RailsScript
2-
VERSION = '2.0.2'
2+
VERSION = '2.0.3'
33
end

vendor/assets/javascripts/rails_script/init.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RailsScript.init = ->
2727

2828
# Clear event handlers on navigation
2929
RailsScript.setClearEventHandlers = ->
30-
jQuery(document).on 'page:before-change turbolinks:before-visit', ->
30+
jQuery(document).on 'page:before-change turbolinks:before-render', ->
3131
for element in [window, document]
3232
for event, handlers of (jQuery._data(element, 'events') || {})
3333
for handler in handlers

0 commit comments

Comments
 (0)