From ebc7fa462c7ce009a38a0d495df5d062864ae3fa Mon Sep 17 00:00:00 2001
From: Oskar Rough
Date: Tue, 15 Nov 2016 23:06:26 +0100
Subject: [PATCH 1/2] Make sure the DOM is parsed after switching
---
index.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/index.js b/index.js
index efa2517..da404ac 100644
--- a/index.js
+++ b/index.js
@@ -77,6 +77,7 @@ Pjax.prototype = {
},
onSwitch: function() {
+ this.parseDOM(document)
trigger(window, "resize scroll")
},
--
2.49.1
From 1a72905c62f81ad15eddc22c905680a016dc7917 Mon Sep 17 00:00:00 2001
From: Oskar Rough
Date: Tue, 15 Nov 2016 23:08:05 +0100
Subject: [PATCH 2/2] Fix reload-link in the example
---
example/example.js | 3 ++-
example/index.html | 2 +-
example/page2.html | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/example/example.js b/example/example.js
index 9441179..f52f8bf 100644
--- a/example/example.js
+++ b/example/example.js
@@ -19,7 +19,8 @@ document.addEventListener("pjax:success", function() {
document.addEventListener("DOMContentLoaded", function() {
var pjax = new Pjax({
- selectors: [".body"],
+ elements: [".js-Pjax"],
+ selectors: [".body"]
// currentUrlFullReload: true,
})
console.log("Pjax initialized.", pjax)
diff --git a/example/index.html b/example/index.html
index 8e259b9..cc95a19 100644
--- a/example/index.html
+++ b/example/index.html
@@ -10,7 +10,7 @@
Index
Hello.
- Go to Page 2 and view your console to see Pjax events.
+ Go to Page 2 and view your console to see Pjax events.
Clicking on this page will just reload the page entierly.