Skip to content

Commit

Permalink
added option to keep scroll position when using Page.refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
patvice committed Jul 26, 2016
1 parent 6a3891f commit 31e3158
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/assets/javascripts/turbograft/turbolinks.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class window.Turbolinks
options.partialReplace ?= false
options.onlyKeys ?= []
options.onLoadFunction = ->
resetScrollPosition() unless options.onlyKeys.length
if !options.onlyKeys.length || options.keepScrollPosition
resetScrollPosition()
options.callback?()

fetchReplacement url, options
Expand Down

0 comments on commit 31e3158

Please sign in to comment.