Sha256: a88eab52df6fcae0b6bc0b0533418ff89f7a11fbf69479ffe76f2728429b6336
Contents?: true
Size: 520 Bytes
Versions: 49
Compression:
Stored size: 520 Bytes
Contents
class TurbolinksReloader run: (options = {}) -> options.keepScrollPosition ?= true if options.keepScrollPosition $(document).one('page:before-unload', $.proxy(@beforeUnload, this)) $(document).one('page:load', $.proxy(@onChange, this)) Turbolinks.visit(window.location.href) beforeUnload: -> @scrollPosition = $(document).scrollTop() onChange: -> $(document).scrollTop(@scrollPosition) $ -> Turbolinks.reloadPage = (options = {}) -> new TurbolinksReloader().run(options)
Version data entries
49 entries across 49 versions & 1 rubygems