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 Aug 9, 2016
1 parent 6a3891f commit d74ab0a
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 d74ab0a

Please sign in to comment.