Merge pull request #119 from MoOx/feature/scroll-restoration
Opt in to manual scroll restoration in browsers that support it
This commit was merged in pull request #119.
This commit is contained in:
4
index.js
4
index.js
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user