Opt in to manual scroll restoration in browsers that support it

This commit is contained in:
Robin North
2018-01-28 14:35:25 +00:00
parent a15c94c55a
commit 8718da35c6

View File

@@ -25,6 +25,10 @@ var Pjax = function(options) {
parseOptions.apply(this,[options]) parseOptions.apply(this,[options])
this.log("Pjax options", this.options) this.log("Pjax options", this.options)
if (this.options.scrollRestoration && "scrollRestoration" in history) {
history.scrollRestoration = "manual"
}
this.maxUid = this.lastUid = newUid() this.maxUid = this.lastUid = newUid()
this.parseDOM(document) this.parseDOM(document)