xpine 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/static/spa.js +8 -2
- package/package.json +1 -1
package/dist/src/static/spa.js
CHANGED
|
@@ -169,14 +169,20 @@ function replaceAttributesOnDocumentBody(dom) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
async function handleBackButton() {
|
|
172
|
+
const initEvent = new CustomEvent("spa-popstate-initiated", {
|
|
173
|
+
detail: {
|
|
174
|
+
href: window.history.state?.targetHref || window.location.href
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
window.dispatchEvent(initEvent);
|
|
172
178
|
if (window.xpineIgnorePopState) return;
|
|
173
179
|
await getNewPageContent(window.history.state?.targetHref || window.location.href);
|
|
174
|
-
const
|
|
180
|
+
const updatedEvent = new CustomEvent("spa-popstate-updated", {
|
|
175
181
|
detail: {
|
|
176
182
|
href: window.history.state?.targetHref || window.location.href
|
|
177
183
|
}
|
|
178
184
|
});
|
|
179
|
-
window.dispatchEvent(
|
|
185
|
+
window.dispatchEvent(updatedEvent);
|
|
180
186
|
}
|
|
181
187
|
function isRelativeURL(url) {
|
|
182
188
|
if (typeof url !== "string") return false;
|